Why does the Google Python Style Guide prefer list comprehensions and for loops instead of filter, map, and reduce?
Deprecated Language Features: ... \"Use list com
map and filter are way less powerful than their list comprehension equivalent. LCs can do both filtering and mapping in one step, they don't require explicit function and can be compiled more efficiently because of their special syntax
# map and filter
map(lambda x:x+1, filter(lambda x:x%3, range(10)))
# same as LC
[x+1 for x in range(10) if x%3]
There is simply no reason to prefer map or filter over LCs.
reduce is slightly different, because there is no equivalent LC, but it has no big advantage over a ordinary for-loop either.