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/2006-February/060608.html below:

[Python-Dev] Let's just *keep* lambda

[Python-Dev] Let's just *keep* lambda [Python-Dev] Let's just *keep* lambdaskip at pobox.com skip at pobox.com
Thu Feb 9 15:52:19 CET 2006
    >> Hmm. Can you give real-world examples (of existing code) where you
    >> needed this?

    Jiwon> Apparently, simplest example is,

    Jiwon> collection.visit(lambda x: print x)

Sure, but has several other people have indicated, statements are not
expressions in Python as they are in C (or in Lisp, which doesn't have
statements).  You can't do this either:

    if print x:
        print 5

because "print x" is a statement, while the if statement only accepts
expressions.

Lambdas are expressions.  Statements can't be embedded in expressions.  That
statements and expressions are different is a core feature of the language.
That is almost certainly not going to change.

Skip
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