Why do class methods share mutable defaults between instances?

François Pinard pinard at iro.umontreal.ca
Wed May 1 10:50:25 EDT 2002


[Ron Teeter]

> It appears that mutable defaults in class methods are shared between
> instances.

Yes.  This is a useful property.  You may often take advantage of this.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard






More information about the Python-list mailing list