1 Oct
2019
1 Oct
'19
9:45 a.m.
On Tue, Oct 1, 2019 at 8:48 AM Ben Rudiak-Gould
mailto:benrudiak@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