On Tue, Oct 1, 2019 at 8:48 AM Ben Rudiak-Gould <benrud...@gmail.com <mailto:benrud...@gmail.com>> wrote:

    Is it? Subtyping in type theory satisfies some axioms, one of which is
    transitivity. The addition of the ABCs broke transitivity:

        >>> issubclass(list, object)
        True
        >>> issubclass(object, collections.abc.Hashable)
        True
        >>> issubclass(list, collections.abc.Hashable)
        False

This isn't really the fault of ABCs, it's a consequence of the fact
that subclasses can nobble certain methods by setting them to None.
The non-transitivity was already there, it's just that issubclass()
doesn't always detect it.

--
Greg
_______________________________________________
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/EQPDWDKVYVHWLZYV2KPEB3YUTXUOUBIB/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to