Steven D'Aprano <steve+pyt...@pearwood.info> added the comment: Not every trivial one-liner needs to be in the standard library. In this case, there are two easy (and obvious) ways to do it:
sum(1 for x in iterator) len(list(iterator)) (The first probably saves memory; the second probably is faster.) Given how rare it is to care ONLY about the length of an iterator, I see no reason why this needs to be in the std lib. If you disagree, please take it to the Python-Ideas mailing list to get community support first before re-opening this ticket. ---------- nosy: +steven.daprano resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32172> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com