Y
Hacker News
new
|
ask
|
show
|
jobs
by
rmc
5038 days ago
I even don't like using map, pefering comprehension.
[w.upper() for w in ["foo", "bar"]]
This underscore.py is not pythonic. Don't use it.
1 comments
jmagnusson
5037 days ago
I completely agree with you. I only used map as he pointed out in the examples how "easy" it was to call it dynamically.
link
masklinn
5037 days ago
An other option if you use map is `operator.methodcaller`, which is also slightly closer in semantics to underscore's invoke (function name specified by string, ability to specify argument to apply to the method, duck-typed).
link