
Oct. 20, 2005
9:51 p.m.
"Guido van Rossum" <guido@python.org> wrote in message news:ca471dc205092017071f2eb1e8@mail.gmail.com...
[Fred]
think iterators shouldn't have length at all: they're *not* containers and shouldn't act that way.
Some iterators can usefully report their length with the invariant: len(it) == len(list(it)).
I still consider this an erroneous hypergeneralization of the concept of iterators. Iterators should be pure iterators and not also act as containers. Which other object type implements __len__ but not __getitem__?
Too late, and probably irrelevant by now; the answer though is set([1,2,3])