Oct. 1, 2019
10:32 p.m.
On Wed, Oct 2, 2019 at 8:29 AM Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
Chris Angelico wrote:
The hashability issue is a logical consequence of accepting that the above violations are reasonable and practically useful.
A more principled way to handle this wouild be for object not to be hashable, and have another base type for hashable objects. Hashable would then be a subtype of object, not the other way around.
The question then would be: why is object() not hashable? It can't be mutable, because then you violate LSP the other way (for the same reason frozenset isn't a subclass of set), and there'd be no logical reason for equality to be defined in any way that would violate hashability. ChrisA