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

Terry Reedy tjreedy at udel.edu
Mon Mar 23 03:01:43 CET 2009

Greg Ewing wrote:

> As for confusion, we ignore the return values of function
> calls all the time, without worrying that someone might be
> confused by the fact that their return value doesn't go
> anywhere. And that's the right way to think of a yield-from
> expression -- as a kind of function call, not a kind of yield.
> If there's anything confusing, it's the presence of the
> word 'yield'. Its only virtue is that it gives a clue that
> the construct has something to do with generators, but
> you'll have to RTM to find out exactly what. Nobody has
> thus far suggested any better name, however.

If the yield in 'yield from' does not make the function a generator, 
then perhaps 'return from' would be clearer.

More information about the Python-Dev mailing list