Message194441
I concede Tim's point about itertools already using underscores where it improves readability of a name :)
So, the latest state of the proposal is to add the following, preferably directly to the module, but at least as a recipe in the itertools docs:
def first_true(iterable, default=None, pred=None):
"""Returns the first true item in the iterable
If no such item is found, returns *default*
If *pred* is not None, returns the first item
for which pred(item) is true.
"""
return next(filter(pred, iterable), default) |
|
Date |
User |
Action |
Args |
2013-08-05 00:04:45 | ncoghlan | set | recipients:
+ ncoghlan, tim.peters, loewis, rhettinger, mark.dickinson, r.david.murray, lukasz.langa, hynek, serhiy.storchaka |
2013-08-05 00:04:45 | ncoghlan | set | messageid: <1375661085.94.0.825989015274.issue18652@psf.upfronthosting.co.za> |
2013-08-05 00:04:45 | ncoghlan | link | issue18652 messages |
2013-08-05 00:04:45 | ncoghlan | create | |
|