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

Chris Angelico rosuav at gmail.com
Mon Nov 24 18:23:31 CET 2014


On Tue, Nov 25, 2014 at 4:18 AM, Chris Barker <chris.barker at noaa.gov> wrote:
> On Mon, Nov 24, 2014 at 9:06 AM, Chris Angelico <rosuav at gmail.com> wrote:
>>
>> I've done my "explain it twice, then shut up" on this subject, so I'll
>> just point you to the list archive, where it's been stated clearly
>> that generators are like __iter__, not like __next__. Please, could
>> you respond to previously-given explanations, rather than simply
>> restating that generators should be like __next__?
>
>
> I'm not sure if I've responded or not to previously given explanations --
> but  you're right, it's time for me to shut up having made my point, too.

Well, there is probably more to be said about this - along the lines
of *why* generators ought to be more like iterators. (They're
iterables, not iterators.) It's just that we seem to be rehashing the
same arguments - or maybe that's just my impression, as there's been
discussion on three different channels (-ideas, -dev, and the issue
tracker - mercifully very little on the latter).

ChrisA


More information about the Python-ideas mailing list