genexp surprise (wart?)

Paul Rubin http
Fri May 26 05:54:56 EDT 2006


"Paul Du Bois" <paul.dubois at gmail.com> writes:
> The second is that you don't like the late-binding behavior of
> generator expressions. PEP 289 has this to say:
> 
> > After much discussion, it was decided that the first (outermost)
> > for-expression should be evaluated immediately and that the remaining
> > expressions be evaluated when the generator is executed.

Thanks.  That PEP is informative.  It shows that I stumbled into
something that other people found confusing too, and that alternatives
were considered that turned out not to be better.



More information about the Python-list mailing list