
March 27, 2011
1:11 p.m.
Ben Finney dixit (2011-03-27, 23:46):
Jan Kaliszewski <zuo@chopin.edu.pl> writes:
Which one of the following do you prefer?
* filter((lambda x: x is None), iterable) * filter(functools.partial(operator.is_, None), iterable) * filter(None, (x is None for x in iterable)) * filter(operator.is_none, iterable)
(x for x in iterable if x is None)
Yeah, you're right. To less sleep... But anyway, I'd prefer filter(is_none, iterable) :) *j