I need to create a mapping from objects of my own custom class (derived from dict) to objects of another custom class. As I see it there are two ways of doing this:
The following should work if you're not storing any additional unhashable objects in your custom class:
def __hash__(self): return hash(self.items())