[Python-ideas] Function to return first(or last) true value from list

Chris Angelico rosuav at gmail.com
Thu Feb 20 17:34:13 CET 2014


On Fri, Feb 21, 2014 at 3:14 AM, Oscar Benjamin
<oscar.j.benjamin at gmail.com> wrote:
> More-itertools does it the way I would but has a long comment
> wondering whether it should actually raise StopIteration:
> https://github.com/erikrose/more-itertools/blob/master/more_itertools/more.py#L37

Has that been subsumed by next(iter(x),default) ?

ChrisA


More information about the Python-ideas mailing list