3 ms·
> What can you do that cannot be as easily done with generator expressions? Technically nothing, but at the same time if you already have a function (especiall
by masklinn 8y ago
> What can you do that cannot be as easily done with generator expressions?
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).