Python map() Function Explained & Visualized

[removed]

Posted Oct 29, 2019, 1:37 PM UTC

33
lanemikmikelane•

Spoiler: it is.

What the article doesn't explain is a good reason to use map. None of the examples given are any more clear, pythonic, or easy to understand than using a comprehension.

2
devishnyaOP•

Thanks for the feedback. However, doesn't utilization of a comprehension come down to the developer's preference?

1
lanemikmikelane•

Most things are. However there is a general consensus that comprehensions ought to be preferred to map and filter.

1