Steve Holden wrote:

I am a *bit* concerned, without really being able to put my finger on
it, that the "yield from" expression's value comes from inside (the
"return" from the nested generator) while the "yield from" expression's
value comes from "outside" (the value passed to a .send() method call).

The send() calls don't go to the yield-from expression, they
go to the yields inside the subgenerator. Similarly, next()
calls get their values from the yields inside the subgenerator.

The only time the yield-from expression itself receives a
value is right at the very end when the subgenerator
terminates, and that's not a yielding operation, it's a
returning operation.

Yield-from is not a kind of yield. It's a kind of function
call.

--
Greg

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to