Why were map and filter kept? What can you do that cannot be as easily done with generator expressions?
for x in map(func, iterable):
...
is cleaner than for x in (func(y) for y in iterable):
...
and shorter than for y in iterable:
x = func(y)
...
But that mostly only makes sense if you already have a suitable named function (e.g. str), and I usually end up going with the third variant anyway.There's an analogous case with filter and `if not cond: continue`.
map and filter calls are trivially rewritten to generator expressions, but it's not necessarily an improvement.
Strangely FP is not popular among python developers.
Technically nothing, but at the same time if you already have a function (especially a builtin) map/filter is more convenient and can be faster. And they're first-class objects which comprehensions are not, which can be convenient.
The goal is not necessarily to prune all redundancies: reduce already existed when sum/min/max/any/all were added, despite the latter being fairly simple special cases of the former (not quite entirely for min/max, but not far).