Is there a way to generate a hash-like ID in for objects in python that is solely based on the objects' attribute values? For example,
class test:
def __init__(self, name):
self.name = name
obj1 = test('a')
obj2 = test('a')
hash1 = magicHash(obj1)
hash2 = magicHash(obj2)
What I'm looking for is something where hash1 == hash2. Does something like this exist in python? I know I can test if obj1.name == obj2.name, but I'm looking for something general I can use on any object.