[Python-Dev] id() on Win64
Finn Bock
bckfnn@worldonline.dk
Thu, 29 Jun 2000 10:43:55 GMT
[Finn Bock]
> This property of id() does not hold in JPython. When used with hotspot,
> id() is not unique.
[Vladimir Marangozov}
>Is it?
>Not unique or not persistent during the object's lifetime?
Not unique. Two different objects can return the same value from
System.identityHashCode().
The HTML java docs have this to say about hashCodes:
"""
As much as is reasonably practical, the hashCode method defined by class
Object does return distinct integers for distinct objects. (This is
typically implemented by converting the internal address of the object
into an integer, but this implementation technique is not required by the
JavaTM programming language.)
"""
Its just one of those small difference that we have to live with. In
pratical term I have seen it cause problems in pickle.py and
copy.deepcopy()
regards,
finn