Skip to content

Comment on Git log in JSON formatparent

Comments

If we are nitpicking then why not

    map(fn, data)

?

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

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.