]> granicus.if.org Git - python/commitdiff
Use "lambda expression" as preferred to "lambda form".
authorGeorg Brandl <georg@python.org>
Sun, 6 Oct 2013 08:26:58 +0000 (10:26 +0200)
committerGeorg Brandl <georg@python.org>
Sun, 6 Oct 2013 08:26:58 +0000 (10:26 +0200)
Doc/faq/design.rst
Doc/reference/compound_stmts.rst
Doc/reference/expressions.rst
Doc/tutorial/controlflow.rst

index 73c90af0372c957301f1832be50bfe927e6cd40a..40babecdb709b3154a8e37a9ef8a84f28cdf72b0 100644 (file)
@@ -372,20 +372,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?
index 7b6c3e222462a760f1b37af4866959fcf9b5ddf0..4a9ad08200ad7a66324ccf63757414eedcff3729 100644 (file)
@@ -509,14 +509,14 @@ receiving any excess positional parameters, defaulting to the empty tuple.  If
 the form "``**identifier``" is present, it is initialized to a new dictionary
 receiving any excess keyword arguments, defaulting to a new empty dictionary.
 
-.. 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.
 
 **Programmer's note:** Functions are first-class objects.  A "``def``" form
index 4b05c374f183f35f8d8670b9bc2e9e919f97e1e7..1e46af2ad327970686661ad430e4466acad6a428 100644 (file)
@@ -184,7 +184,7 @@ brackets:
    list_comprehension: `expression` `list_for`
    list_for: "for" `target_list` "in" `old_expression_list` [`list_iter`]
    old_expression_list: `old_expression` [("," `old_expression`)+ [","]]
-   old_expression: `or_test` | `old_lambda_form`
+   old_expression: `or_test` | `old_lambda_expr`
    list_iter: `list_for` | `list_if`
    list_if: "if" `old_expression` [`list_iter`]
 
@@ -1255,7 +1255,7 @@ Conditional Expressions
 
 .. productionlist::
    conditional_expression: `or_test` ["if" `or_test` "else" `expression`]
-   expression: `conditional_expression` | `lambda_form`
+   expression: `conditional_expression` | `lambda_expr`
 
 Conditional expressions (sometimes called a "ternary operator") have the lowest
 priority of all Python operations.
@@ -1275,14 +1275,13 @@ Lambdas
 
 .. index::
    pair: lambda; expression
-   pair: lambda; form
    pair: anonymous; function
 
 .. productionlist::
-   lambda_form: "lambda" [`parameter_list`]: `expression`
-   old_lambda_form: "lambda" [`parameter_list`]: `old_expression`
+   lambda_expr: "lambda" [`parameter_list`]: `expression`
+   old_lambda_expr: "lambda" [`parameter_list`]: `old_expression`
 
-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 ::
@@ -1291,7 +1290,7 @@ 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.
+functions created with lambda expressions cannot contain statements.
 
 
 .. _exprlists:
index 82fbb82053c7cc42cd9181374e1b527e3f8162fd..4de9ec927f3ab766b08ac65dcb2ee386be3d143d 100644 (file)
@@ -546,7 +546,7 @@ Lambda Expressions
 
 Small anonymous functions can be created with the :keyword:`lambda` keyword.
 This function returns the sum of its two arguments: ``lambda a, b: a+b``.
-Lambda forms can be used wherever function objects are required.  They are
+Lambda functions can be used wherever function objects are required.  They are
 syntactically restricted to a single expression.  Semantically, they are just
 syntactic sugar for a normal function definition.  Like nested function
 definitions, lambda functions can reference variables from the containing