[Python-Dev] gc ideas -- sparse memory (original) (raw)

Terry Reedy tjreedy at udel.edu
Sat Dec 4 04:50:10 CET 2010


On 12/3/2010 7:46 PM, James Y Knight wrote:

Sure they are. This is what Java provides you, for example. If you have fixed, but potentially non-unique ids (in Java you get this using "identityHashCode()"), you can still make an identity

I do not see the point of calling a (non-unique) hash value the identity

hashtable. You simply need to also check using "is" that the two

In Python, that unique isness is the identify.

(a is b) == (id(a) == id(b)) by definition.

objects really are the same one after finding the hash bin using id.

by using the hash value, which is how Python dict operate.

-- Terry Jan Reedy



More information about the Python-Dev mailing list