[Python-ideas] Allowing breaks in generator expressions by overloading the while keyword

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Feb 21 23:37:50 CET 2014


Nick Coghlan wrote:
> Oh, and under such a proposal, the generator expression:
> 
>     (x for x in seq)
> 
> would be semantically equivalent to:
> 
>     (: yield x for x in ?)(seq)

I don't follow that, since 'yield x for x in y' is not
currently a legal expression.

-- 
Greg


More information about the Python-ideas mailing list