| > Sure, that's an option. It's also an option to only write for loops. I gave you a solution that solves readability and costs you nothing in performance, and you reject it without saying why. *shrug* > Reduce is a superset of map/filter Edit: you're saying that reduce can be abused into a map and a filter. Yes, okay I take your point. [deleted] > I meant the actual map, filter, and reduce functions that are part of python I think you meant "not part of python", I guess I'd agree on that, but then again it's irrelevant. I don't care what mechanism you use to iterate over a list and apply a function to every item, whether it be a comprehension or a map function. The end result is the same, and I'd argue that comprehensions are, or can be, a little cleaner syntactically. |
I meant part of python.
https://docs.python.org/3/library/functions.html#map
https://docs.python.org/3/library/functions.html#filter
https://docs.python.org/3/library/functools.html (sadly, I can't link to reduce here)