As mentioned [here](https://stackoverflow.com/questions/17585730/what-does-hash-do-in-python),

Below code,

```
class Person(object):
     def __init__(self, name, ssn, address):
         self.name = name
         self.ssn = ssn
         self.address = address
     def __hash__(self):
         print('in hash')
         return hash(self.ssn)
     def __eq__(self, other):
         print('in eq')
         return self.ssn == other.ssn

bob = Person('bob', '1111-222-333', None)

jim = Person('jim bo', '1111-222-333', 'sf bay area')

dmv_appointments = {}
print('calling hash')
dmv_appointments[bob] = 'tomorrow'
print('calling hash')
print(dmv_appointments[jim])
print('calling hash again')
print(dmv_appointments[bob])

```

---

Output:

```
calling hash
in hash
calling hash
in hash
in eq
tomorrow
calling hash again
in hash
tomorrow

```

---

**Question:**

Why `__eq__` gets called on accessing `jim`but not on `bob`?