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/087387.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) commentsPaul Moore p.f.moore at gmail.com
Sat Mar 21 23:59:47 CET 2009
2009/3/21 Greg Ewing <greg.ewing at canterbury.ac.nz>:
> P.J. Eby wrote:
>
>> My concern is that allowing 'return value' in generators is going to be
>> confusing, since it effectively causes the return value to "disappear" if
>> you're not using it in this special way with some framework that takes
>> advantage.
>
> But part of all this is that you *don't* need a special
> framework to get the return value -- all you need is a
> caller that uses a yield-from statement. There are uses
> for that besides threading systems.

Can they be added to the PEP? Personally, I find the proposal
appealing, and I don't find the semantics hard to understand (although
certainly the expansion given in the "formal semantics" section makes
my head hurt ;-)) but I don't see many actual reasons why it's useful.
(My own use would most likely to be the trivial "for v in g: yield v"
case). More motivating examples would help a lot.

Paul.
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