Currently I\'m doing this:
try: something = iterator.next() # ... except StopIteration: # ...
But I would like an expression th
any won't go beyond the first element if it's True. In case the iterator yields something false-ish you can write any(True for _ in iterator).
any
any(True for _ in iterator)