[Python-ideas] Allow filter(items)

Oscar Benjamin oscar.j.benjamin at gmail.com
Tue Aug 6 15:59:06 CEST 2013


On 5 August 2013 08:46, Peter Otten <__peter__ at web.de> wrote:
> filter(items)
>
> looks much cleaner than
>
> filter(None, items)
>
> and is easy to understand.

I agree. I don't use filter very often and when I do I always have to
think carefully about the order of the arguments. I'd prefer it if it
were more like sort etc.:

    filter(numbers, key=lambda x: x<5)


Oscar


More information about the Python-ideas mailing list