[Python-ideas] Fwd: Fwd: Fwd: unpacking generalisations for list comprehension

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Oct 17 19:17:12 EDT 2016


David Mertz wrote:
>  >>> three_inf = (count(), count(), count())
>  >>> comp = (x for x in flatten(three_inf))
>  >>> next(comp)
> 0
>  >>> next(comp)
> 1 
> 
> It's hard to see how that won't blow up under the new syntax (i.e. 
> generally for all infinite sequences).

It won't blow up, because * in a generator expression
would be equivalent to yield-from.

-- 
Greg


More information about the Python-ideas mailing list