Expression can be simplified on list
MRAB
python at mrabarnett.plus.com
Thu Sep 29 12:36:55 EDT 2016
More information about the Python-list mailing list
Thu Sep 29 12:36:55 EDT 2016
- Previous message (by thread): Expression can be simplified on list
- Next message (by thread): Expression can be simplified on list
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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".
- Previous message (by thread): Expression can be simplified on list
- Next message (by thread): Expression can be simplified on list
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list