The β€˜__hash__’ method can be removed

If a class implements both β€˜__eq__’ and β€˜__hash__’, it's important for those implementations to be consistent with each other:

TIL that Python will try to help you adhere to this constraint in the presence of subclasses. If you define a subclass, and implement β€˜__eq__’ _but not_ β€˜__hash__’, then Python will implicitly set β€˜__hash__’ to β€˜None’ in that class. That way you can't accidentally override the meaning of β€œequals” in a way that breaks hashability.

β€˜object.__hash__’ documentation

This has some ramifications with the type system:

β€˜__hash__’, β€˜__eq__’, and LSP [Python Discourse]

Β» Languages Β» Python