Please explain this strange Python behaviour

Duncan Booth duncan.booth at invalid.invalid
Thu Apr 30 07:59:42 EDT 2009


Tim Chase <python.list at tim.thechases.com> wrote:

> There _are_ cases where it's a useful behavior, but they're rare, 
> so I don't advocate getting rid of it.  But it is enough of a 
> beginner gotcha that it really should be in the Python FAQ at 
> www.python.org/doc/faq/general/
> 

That's an excellent idea!

So excellent in fact that it already is:
http://www.python.org/doc/faq/general/#why-are-default-values-shared-between-objects


-- 
Duncan Booth http://kupuguy.blogspot.com



More information about the Python-list mailing list