Suppose itr_1 is an iterator. Now consider
itr_2 = map(lambda x: x, itr_1)
itr_3 = itr_1
We now have itr_1, itr_2 and itr_3. There are all, effectively, the
same iterator (unless we do an 'x is y' comparision).
I conclude that this suggestion amounts to have a __len__ for ANY
iterator, and not just a map. In other words, this suggestion has
broader scope and consequences than were presented in the original
post.
--
Jonathan
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/