On Tue, Oct 1, 2019 at 8:48 AM Ben Rudiak-Gould <email@example.com mailto:firstname.lastname@example.org> 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.