[issue9703] default param values

Georg Brandl report at bugs.python.org
Sat Aug 28 00:34:15 CEST 2010


Georg Brandl <georg at python.org> added the comment:

This is by design.  Parameter default values are evaluated when the function is defined, not when it is called.  Therefore, by assigning the default value to an instance attribute, you are basically sharing it between instances.

----------
nosy: +georg.brandl
resolution:  -> invalid
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9703>
_______________________________________


More information about the Python-bugs-list mailing list