Unexpected Python Behavior

David Pokorny davebrok at soda.csua.berkeley.edu
Fri Sep 24 15:31:19 CEST 2004

"Fredrik Lundh" <fredrik at pythonware.com> wrote in message >
> it's a well-known "you'll only do this once" mistake.  which is a good

"Because of this feature, it is good programming practice to not use mutable
objects as default values." -- 

Has it been discussed whether it would be a good idea to issue a warning in
this case? It strikes me that a warning wouldn't bother veteran programmers,
since it is really easy to avoid using a mutable default value (nearly
trivial to modify code that does use mutable default values). I'd imagine it
makes code more readable too.

David Pokorny

More information about the Python-list mailing list