The following statements are quotes 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.
When you think about it, this dichotomy is necessary because, again, everything is an object in Python. If integers were not immutable I could change the meaning of the number '2' throughout my program.