Quantcast
Channel: Naftali Harris: Statistician, Hacker, and Climber
Viewing all articles
Browse latest Browse all 48

Python Subclass Relationships Aren't Transitive

$
0
0
Subclass relationships are not transitive in Python. That is, if A is a subclass of B, and B is a subclass of C, it is not necessarily true that A is a subclass of C. The reason for this is that with PEP 3119, anyone is allowed to define their own, arbitrary __subclasscheck__ in a metaclass.

Viewing all articles
Browse latest Browse all 48

Trending Articles