[Python-ideas] Python Object Notation (PyON)

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Nov 5 01:42:53 CET 2008


Arnaud Delobelle wrote:

> For hashable types, equal objects will be factored:
> 
>     >>> t = (1, 2)
>     >>> print dumps(((1, 2), (1, 2)), u=(1, 2))
>     (u, u)

Careful -- hashability is not necessarily the same thing
as immutability. It's possible for an object to be hashable
while still having mutable state, as long as the mutable
state isn't included in the criteria for equality. But
an application may still care about the identity of such
objects.

-- 
Greg



More information about the Python-ideas mailing list