A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-September/128798.html below:

[Python-Dev] Use an empty def as a lambda

[Python-Dev] Use an empty def as a lambda [Python-Dev] Use an empty def as a lambdaBen Gift 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[2])

could look like this:

    words.sort(key = def (x): x[2])

It's obvious and explicit that we're creating an unnamed, anonymous
function this way.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130919/0b985608/attachment-0001.html>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4