Word for a non-iterator iterable?

Alex Martelli aleaxit at yahoo.com
Sun Feb 6 04:17:31 EST 2005


Leif K-Brooks <eurleif at ecritters.biz> wrote:

> Is there a word for an iterable object which isn't also an iterator, and
> therefor can be iterated over multiple times without being exhausted?
> "Sequence" is close, but a non-iterator iterable could technically 
> provide an __iter__ method without implementing the sequence protocol,
> so it's not quite right.

Not just ``technically'' -- a dict is a good and very common example of
just such a "non-iterator, non-sequence iterable".

As you're focusing on "can be iterated over multiple-times", I like
"re-iterable"; it centers on what you can DO with the object, rather
than quibbling what it ISN'T;-)


Alex



More information about the Python-list mailing list