mirror of https://github.com/python/cpython.git
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:
parent
3fbe67abd1
commit
c62cf36e76
|
@ -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}}
|
||||
|
|
Loading…
Reference in New Issue