[Python-ideas] Revised**12 PEP on Yield-From

Nick Coghlan ncoghlan at gmail.com
Sun Apr 19 15:29:39 CEST 2009

Greg Ewing wrote:
>     * ``return expr`` in a generator causes ``StopIteration(expr)`` to
>       be raised.

One minor nit here - this bullet point is somewhat ambiguous as to where
the raised exception is visible. It is probably worth mentioning
explicitly that as with existing "return" statements in generators, the
StopIteration exception won't be seen in the generator's own frame.

As someone else mentioned on another recent draft, it may be worth
including some of the toy examples we were playing with in some of the
discussion threads. Sure, they weren't all that practical, but they
seemed to do a good job of getting the data flow concepts across.

Otherwise looks good to me.


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-ideas mailing list