• Guido van Rossum's avatar
    Make StopIteration a sink state. This is done by clearing out the · 613bed37
    Guido van Rossum yazdı
    object references (it_seq for seqiterobject, it_callable and
    it_sentinel for calliterobject) when the end of the list is reached.
    
    Also remove the next() methods -- one is supplied automatically by
    PyType_Ready() because the tp_iternext slot is set.  That's a good
    thing, because the implementation given here was buggy (it never
    raised StopIteration).
    613bed37
iterobject.c 5.47 KB