Serhiy Storchaka added the comment:
def coalesce(iterable, default=None, pred=None):
return next(filter(pred, iterable), default)
Are you sure you want add this one-line function to the itertools module rather
then to recipes?
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue18652>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com