PEP 289: Generator Expressions (please comment)
Alex Martelli
aleax at aleax.it
Tue Nov 4 17:26:19 EST 2003
kirby urner wrote:
> Alex Martelli <aleax at aleax.it> wrote in message news:
>
>> d = (f(p) for p in X if g(p))
...
> So X in the above could be a a generator-based iterable too. This'd
> be one way to feed generators from other generators.
Yes, definitely -- just like you can write an explicit generator
function today for the same purpose.
Alex
More information about the Python-list
mailing list