Currently I\'m doing this:
try: something = iterator.next() # ... except StopIteration: # ...
But I would like an expression th
What about:
In [1]: i=iter([]) In [2]: bool(next(i,False)) Out[2]: False In [3]: i=iter([1]) In [4]: bool(next(i,False)) Out[4]: True