From: Fred Drake Date: Wed, 18 Jun 2003 17:17:10 +0000 (+0000) Subject: Include "instances of most classes" in a warning about mutable objects X-Git-Tag: 2.2~61 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=82d309b7956683b3958d58708527cc0581b0540b;p=thirdparty%2FPython%2Fcpython.git Include "instances of most classes" in a warning about mutable objects as default values of function/method parameters. --- diff --git a/Doc/tut/tut.tex b/Doc/tut/tut.tex index cba0a8e98bb9..cd5c758a8a96 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=[]):