Make StopIteration a sink state. This is done by clearing out the
it_seq field when the end of the list is reached. Also remove the next() method -- 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).
Showing
Please
register
or
sign in
to comment