[Python-ideas] PEP 479: Change StopIteration handling inside generators

Chris Angelico rosuav at gmail.com
Wed Nov 26 01:37:17 CET 2014


On Wed, Nov 26, 2014 at 10:46 AM, Ethan Furman <ethan at stoneleaf.us> wrote:
> I don't see the difference being subtle enough -- if an odd number of items is tossed in, that `next(i)` is still going
> to raise a StopIteration, which under PEP 479 will become a RunTimeError.
>
> Or did you mean that even numbered iterators will work fine, but odd-numbered ones will still raise?  Nice.  :)

Yes, I meant the silent termination of an iterable with an odd number
of items. That's pretty subtle.

ChrisA


More information about the Python-ideas mailing list