[Python-ideas] Proto-PEP on a 'yield from' statement

George Sakkis george.sakkis at gmail.com
Fri Feb 13 04:12:10 CET 2009


On Thu, Feb 12, 2009 at 8:57 PM, Bruce Frederiksen <dangyogi at gmail.com> wrote:

> I'm also against using return as the syntax for a final value from the
> subgenerator.

Thirded, for two reasons:
- A "yield x" expression has completely different semantics from
"yield from x"; that's a bad idea given how similar they look.
- Returning a value by stuffing it in the StopIteration abuses the
exception mechanism.

Without a compelling, concrete, example I'm -1 on the return part; +1
for the rest.

George



More information about the Python-ideas mailing list