summaryrefslogtreecommitdiff
path: root/Doc/reference/expressions.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2013-10-06 10:28:48 +0200
committerGeorg Brandl <georg@python.org>2013-10-06 10:28:48 +0200
commit6930777c63899e25ad5bb1033da8294f7aaedd4e (patch)
tree6bdb05ac995debacf810f2ebfe59177ccdb7ab5e /Doc/reference/expressions.rst
parentce28e2c24b4c8bbead80f0ef0e948daff3ba4be6 (diff)
parent242e6a0bce9143c62262817b17b46d32a3c916a3 (diff)
downloadcpython-git-6930777c63899e25ad5bb1033da8294f7aaedd4e.tar.gz
merge with 3.3
Diffstat (limited to 'Doc/reference/expressions.rst')
-rw-r--r--Doc/reference/expressions.rst13
1 files changed, 7 insertions, 6 deletions
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index c0132bd471..87a6d2e2b1 100644
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -1218,8 +1218,8 @@ Conditional expressions
.. productionlist::
conditional_expression: `or_test` ["if" `or_test` "else" `expression`]
- expression: `conditional_expression` | `lambda_form`
- expression_nocond: `or_test` | `lambda_form_nocond`
+ expression: `conditional_expression` | `lambda_expr`
+ expression_nocond: `or_test` | `lambda_expr_nocond`
Conditional expressions (sometimes called a "ternary operator") have the lowest
priority of all Python operations.
@@ -1243,10 +1243,10 @@ Lambdas
pair: anonymous; function
.. productionlist::
- lambda_form: "lambda" [`parameter_list`]: `expression`
- lambda_form_nocond: "lambda" [`parameter_list`]: `expression_nocond`
+ lambda_expr: "lambda" [`parameter_list`]: `expression`
+ lambda_expr_nocond: "lambda" [`parameter_list`]: `expression_nocond`
-Lambda forms (lambda expressions) have the same syntactic position as
+Lambda expressions (sometimes called lambda forms) have the same syntactic position as
expressions. They are a shorthand to create anonymous functions; the expression
``lambda arguments: expression`` yields a function object. The unnamed object
behaves like a function object defined with ::
@@ -1255,7 +1255,8 @@ behaves like a function object defined with ::
return expression
See section :ref:`function` for the syntax of parameter lists. Note that
-functions created with lambda forms cannot contain statements or annotations.
+functions created with lambda expressions cannot contain statements or
+annotations.
.. _exprlists: