Kaydet (Commit) 477c8563 authored tarafından Martin v. Löwis's avatar Martin v. Löwis

Move grammar rule for lambda_form into section on lambdas. Fixes #964525.

üst 13ff116a
...@@ -967,8 +967,6 @@ Boolean operations have the lowest priority of all Python operations: ...@@ -967,8 +967,6 @@ Boolean operations have the lowest priority of all Python operations:
{\token{not_test} | \token{and_test} "and" \token{not_test}} {\token{not_test} | \token{and_test} "and" \token{not_test}}
\production{not_test} \production{not_test}
{\token{comparison} | "not" \token{not_test}} {\token{comparison} | "not" \token{not_test}}
\production{lambda_form}
{"lambda" [\token{parameter_list}]: \token{expression}}
\end{productionlist} \end{productionlist}
In the context of Boolean operations, and also when expressions are In the context of Boolean operations, and also when expressions are
...@@ -1006,6 +1004,11 @@ not \code{''}.) ...@@ -1006,6 +1004,11 @@ not \code{''}.)
\indexii{lambda}{form} \indexii{lambda}{form}
\indexii{anonymous}{function} \indexii{anonymous}{function}
\begin{productionlist}
\production{lambda_form}
{"lambda" [\token{parameter_list}]: \token{expression}}
\end{productionlist}
Lambda forms (lambda expressions) have the same syntactic position as Lambda forms (lambda expressions) have the same syntactic position as
expressions. They are a shorthand to create anonymous functions; the expressions. They are a shorthand to create anonymous functions; the
expression \code{lambda \var{arguments}: \var{expression}} expression \code{lambda \var{arguments}: \var{expression}}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment