When is it a pointer (aka reference) - when is it a copy?

Fredrik Lundh fredrik at pythonware.com
Thu Sep 14 03:24:45 EDT 2006


Dennis Lee Bieber wrote:

> 	References to lists, dictionaries, and class instances (which are,
> in a way, just an expanded dictionary) are "mutable"

careful: it's not the *reference* that's mutable, it's the object.

the *only* difference between mutable and immutable objects is that
the latter don't provide any methods that you could use to modify their 
contents.

plain assignment (name=) *never* modifies objects, and *never* copies 
objects.

this article

     http://effbot.org/zone/python-objects.htm

may be useful for those who haven't already seen it.

</F>




More information about the Python-list mailing list