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/087596.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) commentsNick Coghlan ncoghlan at gmail.com
Wed Mar 25 14:37:49 CET 2009
Nick Coghlan wrote:
> With those two ideas combined, the PEP's "yield from" expansion could
> then look like:
> 
>   for x in EXPR:
>     _v = yield x
>     if _v is not None:
>       continue _v
>   else _r:
>     RESULT = _r

Oops, got a little carried away there. Obviously, that doesn't handle
thrown in exceptions the way "yield from" is intended to.

So even with an adjusted for loop the full semantic expansion of 'yield
from' would still need to be defined directly in terms of try/except and
method calls on the underlying iterator to get the desired exception
handling characteristics.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
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