FWIW, I spent some time this morning close-reading the PEP, and made a somewhat significant set of updates -- adding more specifics about the proposed new __futue__ statement and the new code object flag, tracking down a few more examples of code that would be affected, and some other minor edits. Here's the diff:


Hopefully the new version will soon be here:


Note that I am definitely not yet deciding on this PEP. I would love it if people sent in examples of code using generator expressions that would be affected by this change (either by highlighting a bug in the code or by breaking what currently works).

If this PEP gets rejected, we could resurrect the GeneratorExit proposal currently listed as an alternative -- although the more I think about that the less I think it's worth it, except for the very specific case of asyncio (thinking of which, I should add something to the PEP about that too).

--Guido van Rossum (python.org/~guido)