Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a76386 commit fcf9468Copy full SHA for fcf9468
1 file changed
Doc/tut/tut.tex
@@ -1535,19 +1535,17 @@ \subsection{Lambda Forms \label{lambda}}
1535
objects are required. They are syntactically restricted to a single
1536
expression. Semantically, they are just syntactic sugar for a normal
1537
function definition. Like nested function definitions, lambda forms
1538
-cannot reference variables from the containing scope, but this can be
1539
-overcome through the judicious use of default argument values:
+can reference variables from the containing scope:
1540
1541
\begin{verbatim}
1542
>>> def make_incrementor(n):
1543
-... return lambda x, incr=n: x+incr
+... return lambda x: x + n
1544
...
1545
>>> f = make_incrementor(42)
1546
>>> f(0)
1547
42
1548
>>> f(1)
1549
43
1550
->>>
1551
\end{verbatim}
1552
1553
0 commit comments