discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Proposal for change of connect arguments


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] Proposal for change of connect arguments
Date: Sun, 6 Feb 2005 08:48:09 -0800
User-agent: Mutt/1.5.6i

On Sun, Feb 06, 2005 at 12:34:55PM +0100, Thomas Traber wrote:
> Instead of typing
> 
> >   connect(src,bandfilter)
> >   connect(bandfilter,hilbert)
> >   connect(hilbert,real)
> >   connect(real,dest)
> 
> I would prefer
> 
> >   connect(src,bandfilter,hilbert,real,dest)
> 
> As I don't know how to handle variable
> length arguments in python I tried it
> with a list:
> 
> >   connect([src,bandfilter,hilbert,real,dest])
> 
> Here is the diff for basic_flow_graph.py using an optional list:

Thanks for the idea and the code.  I like code ;-)

I'll rework it to use a variable length argument list and add it to CVS.

  # http://docs.python.org/ref/function.html
  def connect (*rest):
    ...


The only downside I see is that it implicitly assumes that you're
always pairing input port N with output port N for a given block.
It does however succinctly handle the common case.

Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]