A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-March/087769.html below:

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

[Python-Dev] PEP 380 (yield from a subgenerator) comments [Python-Dev] PEP 380 (yield from a subgenerator) commentsGreg Ewing greg.ewing at canterbury.ac.nz
Fri Mar 27 11:54:03 CET 2009
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

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4