N
Nomak
Hello,
does python have an equivalent to Java: int Object.hashCode() ?
TIA
does python have an equivalent to Java: int Object.hashCode() ?
TIA
Hello,
does python have an equivalent to Java: int Object.hashCode() ?
Bruno said: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.
Traceback (most recent call last):>>> hash([])
Bruno Desthuilliers said: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.)
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.