Re:Anti-Patterns in Python Programming
by metaphorm on Wednesday July 09, 2014 @10:09AM
(#8009677)
you can consider a list comprehension to be a sort of literal representation of the result of map. I think literals have a benefit for code readability and should be used when feasible (i.e. the literal is compact enough).
the other reason its considered more idiomatic in Python is just because the compiler does a better job of parsing and optimizing list comprehensions.
the other reason its considered more idiomatic in Python is just because the compiler does a better job of parsing and optimizing list comprehensions.