Re: Pointer or unique id

2005-01-15 Thread Terry Reedy
"Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >id(object) -> integer >Return the identity of an object. This is guaranteed to be unique among >simultaneously existing objects. This is part of the language specification. Also, the identity of an object must

Re: Pointer or unique id

2005-01-15 Thread Bruno Desthuilliers
Nomak a écrit : Hello, does python have an equivalent to Java: int Object.hashCode() ? id(object) -> integer Return the identity of an object. This is guaranteed to be unique among simultaneously existing objects. (Hint: it's the object's memory address.) hash(obj) -> integer Return a hash valu

Re: Pointer or unique id

2005-01-15 Thread Michael Hoffman
Bruno Desthuilliers wrote: hash(obj) -> integer Return a hash value for the object. Two objects with the same value have the same hash value. The reverse is not necessarily true, but likely. Of course not all Python objects are hashable: >>> hash([]) Traceback (most recent call last): File "",