mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
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
1 changed files with 2 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue