[Python-Dev] Return from generators in Python 3.2 (original) (raw)

Scott Dial scott+python-dev at scottdial.com
Thu Aug 26 18:20:15 CEST 2010


On 8/26/2010 11:00 AM, Yury Selivanov wrote:

If we decide to postpone this feature till Python 3.3, than we'll push it all back The change is tiny, but it means really a lot.

AFAICT, this change was the most controversial part of PEP 380.

PS I'm attaching a patch to the letter; it's far from ideal state, but contains the GeneratorReturn exception, code to raise it and the corresponding unittests.

I believe overloading StopIteration for this purpose was considered more acceptable than creating a new exception. BTW, attaching patches to emails on this list is generally the best way to have few look at your patch. :-p Also, this seems more appropriate for python-ideas.

-- Scott Dial scott at scottdial.com scodial at cs.indiana.edu



More information about the Python-Dev mailing list