]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Include "instances of most classes" in a warning about mutable objects
authorFred Drake <fdrake@acm.org>
Wed, 18 Jun 2003 17:14:29 +0000 (17:14 +0000)
committerFred Drake <fdrake@acm.org>
Wed, 18 Jun 2003 17:14:29 +0000 (17:14 +0000)
as default values of function/method parameters.

Doc/tut/tut.tex

index c9dd660f8752c26c1394b7fab3083b5e4321ca53..1be251ee04d095f30d6f58f60c42224469be8b0b 100644 (file)
@@ -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=[]):