[Python-ideas] Allow filter(items)

Stephen J. Turnbull stephen at xemacs.org
Wed Aug 7 05:38:34 CEST 2013


Peter Otten writes:

 > filter(items)
 > 
 > looks much cleaner than
 > 
 > filter(None, items)

Sure.  But the filter function is the important thing here.  'items'
is probably a conceptual dummy (the reader already knows what 'items'
refers to and is expecting it to be filtered).

I'd be more sympathetic to omitting the function if you were
suggesting that containers grow a filter method:

    items.filter()

Nevertheless, I still would prefer

    items.filter(bool)

So, -1.


More information about the Python-ideas mailing list