I was reading about hashable in Python and got the idea that in python a hashable obj must have hash and eq method defined. That makes sense to me as of now and I am learning more about it.
But in between, one thing going in my mind is when I did dir(mutable_obj) I see that they also having eq and hash method present. My expectation was it should not have hash method defined.
Example : ''' python i_list = [1,2,3,4,5] dir(i_list) ''' It gives me below output
['__add__', '__class__', '__contains__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__gt__', '__hash__', '__init__', '__iter__', '__le__', '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'count', 'index']