filter(function, iterable)
itertools.ifilter(function, iterable)
future_builtins.filter(function, iterable)
itertools.ifilterfalse(function, iterable)
itertools.filterfalse(function, iterable)
function
| callable that determines the condition or None
then use the identity function for filtering (positional-only)iterable
| iterable that will be filtered (positional-only)In most cases a comprehension or generator expression is more readable, more powerful and more efficient than filter()
or ifilter()
.