[Python-ideas] Allow filter(items)

Serhiy Storchaka storchaka at gmail.com
Mon Aug 5 20:25:22 CEST 2013


05.08.13 20:32, Markus Unterwaditzer написав(ла):
> -0, for reasons already mentioned. While i agree that filter(None, items) is counterintuitive, filter(bool, items) looks very readable to me.

filter(bool, items) is redundant in same sense as `if bool(x)`, `for x 
in iter(items)`, or `"%s" % str(x)`. A result of the predicate is 
implicitly called to boolean.




More information about the Python-ideas mailing list