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/2000-March/002468.html below:

[Python-Dev] return statements in lambda

[Python-Dev] return statements in lambda [Python-Dev] return statements in lambdaFredrik Lundh Fredrik Lundh" <effbot@telia.com
Sun, 5 Mar 2000 10:24:37 +0100
from "Python for Lisp Programmers":
http://www.norvig.com/python-lisp.html

> Don't forget return. Writing def twice(x): x+x is tempting
> and doesn't signal a warning or > ception, but you probably
> meant to have a return in there. This is particularly irksome
> because in a lambda you are prohibited from writing return,
> but the semantics is to do the return.=20

maybe adding an (optional but encouraged) "return"
to lambda would be an improvement?

    lambda x: x + 10

vs.

    lambda x: return x + 10

or is this just more confusing...  opinions?

</F>




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