The last two example functions in the section about default argument

values (4.7.1) should return l, not a.  Reported by Axel Boldt.
This commit is contained in:
Guido van Rossum 1998-10-24 13:15:28 +00:00
parent 3fbe67abd1
commit c62cf36e76
1 changed files with 2 additions and 2 deletions

View 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}}