Closed auscompgeek closed 6 years ago
With a C.__hash__() method, issubclass(C, collections.abc.Hashable) returns True. Overriding __eq__() causes __hash__ to be set to None, which gives us the behaviour that we want.
C.__hash__()
issubclass(C, collections.abc.Hashable)
__eq__()
__hash__
With a
C.__hash__()
method,issubclass(C, collections.abc.Hashable)
returns True. Overriding__eq__()
causes__hash__
to be set to None, which gives us the behaviour that we want.