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

P.J. Eby pje at telecommunity.com
Thu Mar 26 22:19:09 CET 2009


At 12:27 PM 3/26/2009 -0700, Guido van Rossum wrote:
>There is some clear low-hanging fruit for Greg's proposal
>where no trampoline or helpers are needed -- but where currently
>refactoring complex code containing many yield statements is
>cumbersome due to the nee to write each "subroutine" call as "for x in
>subroutine(): yield x" -- being able to replace this with "yield from
>subroutine()" is a conceptual advantage to me that is not proportional
>to the number of characters saved.

Right - I don't object to the concept of "yield from" -- I'm -0 on 
that.  What I don't like is the confusion of adding "return values" 
to generators, at least using the 'return' statement.



More information about the Python-Dev mailing list