I wish `any()` returned the first truthy item in an iterable instead of `True`.
¹ https://docs.python.org/3/library/itertools.html#itertools-r...
² https://more-itertools.readthedocs.io/en/stable/api.html#mor...
next((I for I in iter if is_thing(I)), default)
It’s slightly more work than any but is pretty much all I need when I need to handle whatever values are returned from the any.If exists(y){x : x % 2 == 0 for x in numbers}: Print y
There is also a “for all” statement which can return the first offender which does not satisfy the condition.
It’s an awkward but incredibly useful language choice - it would be interesting to see it explored more in mainstream languages.