[Python-Dev] Use an empty def as a lambda
benhgift at gmail.com
Thu Sep 19 22:54:08 CEST 2013
I think the lambda keyword is difficult to understand for many people. It
would be more pythonic to use an empty def call instead.
For instance this:
words.sort(key = lambda x: x)
could look like this:
words.sort(key = def (x): x)
It's obvious and explicit that we're creating an unnamed, anonymous
function this way.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev