Mutable types, immutable types, object references
The following statements are quatations from Jeff Knupp's blog-post "Is Python call-by-value or call-by-reference? Neither."
In Python a variable is not an alias for a location in memory. Rather, it is simply a binding to a Python object.
- Changes to a mutable object are visible through all names bound to it. Python's lists are an example of mutable objects.
- The value of immutable objects can not be modified after they are created. They can be used to compute the values of new objects, which is how a function like string.join works.
The following types are immutable: