Explanation of list reference
On Sat, 15 Feb 2014 15:40:54 -0500, Terry Reedy wrote:
> 'Identity' is an abstraction. For immutable objects, it is essentially
> irrelevant. For mutable objects, it is essential in the following sense.
> A and B are the same object if mutating A necessarily mutates B and
> different if they can be independently mutated.
That's not quite right. See the earlier example in this thread about
numpy arrays. Since mutator methods can have side-effects, and objects
can act as proxies or views to other methods, we can't make any
conclusion about identity from the fact that mutation affects two or more
[Aside: I think the numpy array API is poor, since it doesn't make clear
the distinction between arrays which are being used as views to another
array, and arrays which are being used as independent arrays.]