class Hero:

    def __init__(self, name, age):
        self.name = name
self.age = age

def __str__(self):
    return self.name + str(self.age)

def __hash__(self):
    print(hash(str(self)))
How to make an object properly hashable?