Sep 1, 2018 · 1 min read
Hate to break it to you — standard practice recommends against using map these days, in favor of list comprehensions and generators, because they’re much easier to read.
I mean, which is clearer:
y = map(lambda i: i + 1, x)or
y = [i + 1 for i in x]?
(Also — your iteration variable x is the same as the list you’re iterating over, so your code destroys the list you started with, and is also somewhat confusing…)
