>> 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
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com