[Python-Dev] Termination of two-arg iter()

Guido van Rossum guido@python.org
Sun, 14 Jul 2002 10:32:36 -0400


> An alternative approach would be to raise an exception when calling
> iter() on an exhausted iterator. This is orthogonal to whatever
> .next() does on such and iterator.

This just adds more complicated rules to no avail.  iter() on an
iterator should return that iterator itself.  The state of that
iterator is what it is.

--Guido van Rossum (home page: http://www.python.org/~guido/)