[Python-ideas] Proto-PEP on a 'yield from' statement
Bruce Frederiksen
dangyogi at gmail.com
Fri Feb 13 07:30:50 CET 2009
George Sakkis wrote:
> - 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.
>
In thinking about this some more, what I think makes more sense is to
simply return the final value from close rather than attaching it to
StopIteration. This still leaves open the syntax to use for this inside
the generator. Perhaps:
return finally some_value
-bruce frederiksen
More information about the Python-ideas
mailing list