diff options
author | Fred Drake <fdrake@acm.org> | 2003-06-18 17:14:29 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2003-06-18 17:14:29 (GMT) |
commit | 3a8fbe7eeca4cc8cb944c8120690e54a6c775747 (patch) | |
tree | 16a8f3da97c446f7663ff763a14a22742bdbb258 /Doc/tut | |
parent | 5edd785bbb1825e8b4e89525b2dad0cec3a9394d (diff) | |
download | cpython-3a8fbe7eeca4cc8cb944c8120690e54a6c775747.zip cpython-3a8fbe7eeca4cc8cb944c8120690e54a6c775747.tar.gz cpython-3a8fbe7eeca4cc8cb944c8120690e54a6c775747.tar.bz2 |
Include "instances of most classes" in a warning about mutable objects
as default values of function/method parameters.
Diffstat (limited to 'Doc/tut')
-rw-r--r-- | Doc/tut/tut.tex | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/tut/tut.tex b/Doc/tut/tut.tex index c9dd660..1be251e 100644 --- a/Doc/tut/tut.tex +++ b/Doc/tut/tut.tex @@ -1388,8 +1388,9 @@ will print \code{5}. \strong{Important warning:} The default value is evaluated only once. This makes a difference when the default is a mutable object such as a -list or dictionary. For example, the following function accumulates -the arguments passed to it on subsequent calls: +list, dictionary, or instances of most classes. For example, the +following function accumulates the arguments passed to it on +subsequent calls: \begin{verbatim} def f(a, L=[]): |