summaryrefslogtreecommitdiffstats
path: root/Doc/reference
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2013-10-06 08:28:39 (GMT)
committerGeorg Brandl <georg@python.org>2013-10-06 08:28:39 (GMT)
commit242e6a0bce9143c62262817b17b46d32a3c916a3 (patch)
tree6809c08bba20801364c960703908693a6721baf0 /Doc/reference
parentde5aff1bdc65a562c15cdd5a661dc666cb25ec16 (diff)
downloadcpython-242e6a0bce9143c62262817b17b46d32a3c916a3.zip
cpython-242e6a0bce9143c62262817b17b46d32a3c916a3.tar.gz
cpython-242e6a0bce9143c62262817b17b46d32a3c916a3.tar.bz2
Use "lambda expression" as preferred to "lambda form".
Diffstat (limited to 'Doc/reference')
-rw-r--r--Doc/reference/compound_stmts.rst10
-rw-r--r--Doc/reference/expressions.rst13
2 files changed, 12 insertions, 11 deletions
diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst
index d0d0646..8afc69e 100644
--- a/Doc/reference/compound_stmts.rst
+++ b/Doc/reference/compound_stmts.rst
@@ -535,17 +535,17 @@ function. The annotation values are available as values of a dictionary keyed
by the parameters' names in the :attr:`__annotations__` attribute of the
function object.
-.. index:: pair: lambda; form
+.. index:: pair: lambda; expression
It is also possible to create anonymous functions (functions not bound to a
-name), for immediate use in expressions. This uses lambda forms, described in
-section :ref:`lambda`. Note that the lambda form is merely a shorthand for a
+name), for immediate use in expressions. This uses lambda expressions, described in
+section :ref:`lambda`. Note that the lambda expression is merely a shorthand for a
simplified function definition; a function defined in a ":keyword:`def`"
statement can be passed around or assigned to another name just like a function
-defined by a lambda form. The ":keyword:`def`" form is actually more powerful
+defined by a lambda expression. The ":keyword:`def`" form is actually more powerful
since it allows the execution of multiple statements and annotations.
-**Programmer's note:** Functions are first-class objects. A "``def``" form
+**Programmer's note:** Functions are first-class objects. A "``def``" statement
executed inside a function definition defines a local function that can be
returned or passed around. Free variables used in the nested function can
access the local variables of the function containing the def. See section
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index c0132bd..87a6d2e 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: