On 2016-09-29 16:56, Steve D'Aprano wrote:
On Thu, 29 Sep 2016 09:53 pm, MRAB wrote:What if an _exhausted_ iterator was falsey?The problem is that in general you can't tell if an iterator is exhausted until you attempt to advance it. So even if bool(iterator) returns True, the call to next() may raise StopIteration:
[snip] By "exhausted" I meant "has previously raised StopIteration". -- https://mail.python.org/mailman/listinfo/python-list