Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Dear Python.
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-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?
There are no comments on this comment yet.
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-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?