Message248496
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. |
|
Date |
User |
Action |
Args |
2015-08-13 04:44:20 | rhettinger | set | recipients:
+ rhettinger, steven.daprano, r.david.murray, flying sheep |
2015-08-13 04:44:20 | rhettinger | set | messageid: <1439441060.69.0.0658932411384.issue24849@psf.upfronthosting.co.za> |
2015-08-13 04:44:20 | rhettinger | link | issue24849 messages |
2015-08-13 04:44:19 | rhettinger | create | |
|