3 ms·
In regards to the complaint on lambda, isn't it more pythonic to use list comprehensions anyway? intlist=range(0,16) filter(lambda x: x % 3 == 0, intlist) vs
by metamemetics 17y ago
In regards to the complaint on lambda, isn't it more pythonic to use list comprehensions anyway?
intlist=range(0,16)
filter(lambda x: x % 3 == 0, intlist)
vs.
[x for x in intlist if x % 3 == 0]
Should be faster too: http://stackoverflow.com/questions/1247486/python-list-comprehension-vs-map http://stackoverflow.com/questions/1247486/python-list-compr...
I know anonymous functions are idiomatic in javascript from using jquery, but I rarely use them in python. Does anyone have a good example of leveraging lambda in python?