]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Make StopIteration a sink state. This is done by clearing out the
authorGuido van Rossum <guido@python.org>
Tue, 16 Jul 2002 20:24:46 +0000 (20:24 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 16 Jul 2002 20:24:46 +0000 (20:24 +0000)
commit613bed3726af921be64900bd0cb8209193873411
treefcb29d8f30605df0371a24b50bfe1d6e504bec47
parent6b6272c8575879cb792d2ea76544597c27ab0de4
Make StopIteration a sink state.  This is done by clearing out the
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).
Objects/iterobject.c