class Test:

    def __init__(self, name):
        self.name = name
test_Dict = {}
obj = Test('abc')
test_Dict[obj] = obj
print(test_Dict[obj].name)
Using object as key in dictionary in Python - Hash function