On Wed, Oct 2, 2019 at 8:29 AM Greg Ewing <greg.ew...@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
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/7O73MVQBTJ4VYUOJ3Z2HQPO2JWH7K7TR/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to