I read this (from here):
User-defined classes have
__eq__()
and__hash__()
methods by default; with them, all objects compare unequal (except with themselves) andx.__hash__()
returns an appropriate value such that x == y implies both that x is y and hash(x) == hash(y).
And I wish to know if the __eq__()
method by default is defined like:
def __eq__(self, other):
return hash(self) == hash(other)