[Python-Dev] PEP 380 (yield from a subgenerator) comments

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Mar 25 06:09:36 CET 2009


Steve Holden wrote:
> What about extending the syntax somewhat to
> 
>   yield expr for x from X

I can't see much advantage that would give you
over writing

   for x in X:
     yield expr

There would be little or no speed advantage,
since you would no longer be able to shortcut
the intermediate generator during next().

-- 
Greg


More information about the Python-Dev mailing list