Context I want to implement a language on top of python where I need to add meta-data to existing python objects, but I don't want to modify the underlying representation of all python objects. I can compute and store the id of EVERY object, then use as key for a traditional Python dict. but this is an incredible waste, since those IDs are very quickly derivable from the objects themselves. Other programming languages (Lisp, Java, etc.) have an "identity hash" which hashes based on the identity of the key object with ever calling its hash function.
Can I do this in Python without without writing my own hash from scratch?