Hacker News new | ask | show | jobs
by zokier 3990 days ago
If we are nitpicking then why not

    map(fn, data)

?
1 comments

List comprehensions are more direct, support more than just a function call, and in py3 map returns an iterable instead of a list (granted, easily solvable by list(map()) but it's an extra concern)

List comprehensions are the very recommended strategy for constructing python lists, not to mention they're simply a fantastic language feature. Very direct, readable, and hard to get wrong.

Python loses out a lot on it's functional sorts of functions (filter, map) because you can't use method chaining on a list for them, imo