This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients flying sheep, r.david.murray, rhettinger, steven.daprano
Date 2015-08-13.04:44:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1439441060.69.0.0658932411384.issue24849@psf.upfronthosting.co.za>
In-reply-to
Content
I had explored this idea previously at some length (no pun intended) but it was mostly a dead-end.  The best we ended-up with has having __length_hint__ to indicate size to list().   

There were several issues some of which at detailed in the comment at the top of https://hg.python.org/cpython/file/tip/Lib/test/test_iterlen.py .  Another *big* issue was that Guido was adamantly opposed to iterators having a length because it changed their boolean value from always-true and it broke some of his published code that depended on iterators never being false, even when empty.
History
Date User Action Args
2015-08-13 04:44:20rhettingersetrecipients: + rhettinger, steven.daprano, r.david.murray, flying sheep
2015-08-13 04:44:20rhettingersetmessageid: <1439441060.69.0.0658932411384.issue24849@psf.upfronthosting.co.za>
2015-08-13 04:44:20rhettingerlinkissue24849 messages
2015-08-13 04:44:19rhettingercreate