Hacker News new | ask | show | jobs
by metalliqaz 2895 days ago
I assume it's because of this...

Zen of Python: There should be one-- and preferably only one --obvious way to do it.

1 comments

True, but, if it were just that, I would expect Python to only have the map, filter, etc. functions, which have been in there since 1.0. List comprehensions were introduced much later, in version 2.

That makes comprehensions the 2nd way to do it. They're also less obvious in my book, since their readability tends to drop precipitously once you start adding multiple "for" clauses to one.