Re: [Python-Dev] itertools.chain should take an iterable ?

2005-09-02 Thread Paolino
Christos Georgiou wrote: > "Paolino" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > >>What if I want to chain an infinite list of iterables? >>Shouldn't itertools.chain be built to handle that? > > > Raymond already suggested a four-line function that does exactly that. >

Re: [Python-Dev] itertools.chain should take an iterable ?

2005-09-02 Thread Christos Georgiou
"Paolino" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > What if I want to chain an infinite list of iterables? > Shouldn't itertools.chain be built to handle that? Raymond already suggested a four-line function that does exactly that. Create your own personal-library modules co

Re: [Python-Dev] itertools.chain should take an iterable ?

2005-09-02 Thread Raymond Hettinger
[Paolino] > >>Well this happened after I tried instinctively > >>itertools.chain(child.method() for child in self). As Jack's note points out, your proposed signature is incompatible with the one we have now. I recommend creating your own version: def paolino_chain(iterables): for

Re: [Python-Dev] itertools.chain should take an iterable ?

2005-09-02 Thread Paolino
Jack Diederich wrote: > On Thu, Sep 01, 2005 at 07:58:40PM +0200, Paolino wrote: > >>Working on a tree library I've found myself writing >>itertools.chain(*[child.method() for child in self]). >>Well this happened after I tried instinctively >>itertools.chain(child.method() for child in self). >

Re: [Python-Dev] itertools.chain should take an iterable ?

2005-09-01 Thread Jack Diederich
On Thu, Sep 01, 2005 at 07:58:40PM +0200, Paolino wrote: > Working on a tree library I've found myself writing > itertools.chain(*[child.method() for child in self]). > Well this happened after I tried instinctively > itertools.chain(child.method() for child in self). > > Is there a reason for t

[Python-Dev] itertools.chain should take an iterable ?

2005-09-01 Thread Paolino
Working on a tree library I've found myself writing itertools.chain(*[child.method() for child in self]). Well this happened after I tried instinctively itertools.chain(child.method() for child in self). Is there a reason for this signature ? Regards paolino