Unexpected Python Behavior

Fredrik Lundh fredrik at pythonware.com
Fri Sep 24 16:15:11 CEST 2004


David Pokorny wrote:

> 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.

1) you cannot tell if an object is mutable or not

2) there are lots of valid uses for object binding (see the "This feature can
   be useful" part in the FAQ for one example)

</F> 






More information about the Python-list mailing list