diff options
author | Georg Brandl <georg@python.org> | 2013-10-06 08:28:48 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2013-10-06 08:28:48 (GMT) |
commit | 6930777c63899e25ad5bb1033da8294f7aaedd4e (patch) | |
tree | 6bdb05ac995debacf810f2ebfe59177ccdb7ab5e /Doc/faq | |
parent | ce28e2c24b4c8bbead80f0ef0e948daff3ba4be6 (diff) | |
parent | 242e6a0bce9143c62262817b17b46d32a3c916a3 (diff) | |
download | cpython-6930777c63899e25ad5bb1033da8294f7aaedd4e.zip cpython-6930777c63899e25ad5bb1033da8294f7aaedd4e.tar.gz cpython-6930777c63899e25ad5bb1033da8294f7aaedd4e.tar.bz2 |
merge with 3.3
Diffstat (limited to 'Doc/faq')
-rw-r--r-- | Doc/faq/design.rst | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst index 724eecf..0f1c558 100644 --- a/Doc/faq/design.rst +++ b/Doc/faq/design.rst @@ -347,20 +347,20 @@ Answer 2: Fortunately, there is `Stackless Python <http://www.stackless.com>`_, which has a completely redesigned interpreter loop that avoids the C stack. -Why can't lambda forms contain statements? ------------------------------------------- +Why can't lambda expressions contain statements? +------------------------------------------------ -Python lambda forms cannot contain statements because Python's syntactic +Python lambda expressions cannot contain statements because Python's syntactic framework can't handle statements nested inside expressions. However, in Python, this is not a serious problem. Unlike lambda forms in other languages, where they add functionality, Python lambdas are only a shorthand notation if you're too lazy to define a function. Functions are already first class objects in Python, and can be declared in a -local scope. Therefore the only advantage of using a lambda form instead of a +local scope. Therefore the only advantage of using a lambda instead of a locally-defined function is that you don't need to invent a name for the function -- but that's just a local variable to which the function object (which -is exactly the same type of object that a lambda form yields) is assigned! +is exactly the same type of object that a lambda expression yields) is assigned! Can Python be compiled to machine code, C or some other language? |