[Python-Dev] Please reconsider PEP 479.

Chris Angelico rosuav at gmail.com
Wed Nov 26 02:29:59 CET 2014


On Wed, Nov 26, 2014 at 11:58 AM, Greg <greg.ewing at canterbury.ac.nz> wrote:
> The Abstract claims that the proposal will "unify the behaviour of
> list comprehensions and generator expressions", but it doesn't do
> that.

I don't know that it completely unifies the behaviours, but it does
merge them on the specific situation of a leaking StopIteration. With
the original code examples that sparked this all off (see the first
footnote in the PEP), current CPython has the list-comp form terminate
cleanly, while the genexp form infinitely loops. With the POC patch on
the issue tracker, both forms cause RuntimeError. Is there a better
word than "unify" for that?

ChrisA


More information about the Python-Dev mailing list