Feb. 18, 2014
10:42 p.m.
[Ryan Gonzalez <rymg19@gmail.com>]
It isn't uncommon to try and get either the first or the last True value from a list. In Python 2, you'd do this:
next((x for x in mylist if x))
And, in Python 3, thanks to filter returning an iterator, you'd do this:
next(filter(bool,mylist)) ...
See here: http://bugs.python.org/issue18652 Never heard anyone ask for "last" before "first" has been available in a PyPI package for over a year. Detail in the bug report.