Author serhiy.storchaka
Recipients hynek, loewis, lukasz.langa, mark.dickinson, ncoghlan, rhettinger, serhiy.storchaka
Date 2013-08-04.13:29:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1375622981.3.0.387078682534.issue18652@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2013-08-04 13:29:41serhiy.storchakasetrecipients: + serhiy.storchaka, loewis, rhettinger, mark.dickinson, ncoghlan, lukasz.langa, hynek
2013-08-04 13:29:41serhiy.storchakasetmessageid: <1375622981.3.0.387078682534.issue18652@psf.upfronthosting.co.za>
2013-08-04 13:29:41serhiy.storchakalinkissue18652 messages
2013-08-04 13:29:41serhiy.storchakacreate