[Python-ideas] Break the dominance of boolean values in boolean context
steve at pearwood.info
Fri Sep 16 05:57:55 CEST 2011
Greg Ewing wrote:
> On 15/09/11 11:25, MRAB wrote:
>> Could it also have something like a 'key' argument, by default
> Or more generally, a function.
> Although that's not strictly necessary. If there were a first()
> function that simply returned the first item from an iterator,
> whether true or not, one could write
> first(itertools.ifilter(func, something))
Surely the way to return the first item from an iterator, whether true
or not, is next(iterator)?
More information about the Python-ideas