]> granicus.if.org Git - python/commitdiff
The last two example functions in the section about default argument
authorGuido van Rossum <guido@python.org>
Sat, 24 Oct 1998 13:15:28 +0000 (13:15 +0000)
committerGuido van Rossum <guido@python.org>
Sat, 24 Oct 1998 13:15:28 +0000 (13:15 +0000)
values (4.7.1) should return l, not a.  Reported by Axel Boldt.

Doc/tut/tut.tex

index e16fc46546f0ca5872fa36161801c9ea2a3263d7..f9754365a02d7e8bdcb470cacd58ca3720fe6b7f 100644 (file)
@@ -1171,7 +1171,7 @@ the arguments passed to it on subsequent calls:
 \begin{verbatim}
 def f(a, l = []):
     l.append(a)
-    return a
+    return l
 print f(1)
 print f(2)
 print f(3)
@@ -1193,7 +1193,7 @@ def f(a, l = None):
     if l is None:
         l = []
     l.append(a)
-    return a
+    return l
 \end{verbatim}
 
 \subsection{Keyword Arguments \label{keywordArgs}}