[Python-ideas] Allow filter(items)

Joshua Landau joshua at landau.ws
Wed Aug 7 04:52:48 CEST 2013


On 7 August 2013 03:46, Shane Green <shane at umbrellacode.com> wrote:
> It seems kind of like there should be a filtered operation like there is a
> sorted one.

filtered would be identical to filter as-is. sorted is a counterpart
to a method, not another function.

> (and why not have a list.filter(predicate=None) to perform in place
> filtering for that matter?)

sorted actually just converts to a list and then runs the sort method
AFAICT. sort is defined in-place because it's efficient that way. None
of this applies to filter.


More information about the Python-ideas mailing list