Word for a non-iterator iterable?
Terry Reedy
tjreedy at udel.edu
Mon Feb 7 16:42:05 EST 2005
"Oren Tirosh" <oren at REMOVETHIS1.hishome.net> wrote in message
news:cf052f0d.0502071110.4e9611e0 at posting.google.com...
> But when iter() returns the same object - well, that's a
> sign that the object is definitely not reiterable.
Unless, of course, __iter__ resets the iteration variable to its starting
value. But it would definitely not be simultaneously doubly iterable, as
one would want to compute a self crossproduct. And one could object that
such an __iter__ is not proper for an iterator (return self and do nothing
else). So such an __iter__ should better be written, perhap as a generator
function, to return an independent object with independently initialized
iteration variable.
Terry J. Reedy
More information about the Python-list
mailing list