How do I check (at runtime) if one class is a subclass of another?
issubclass(class, classinfo)
Excerpt:
Return true if
class
is a subclass (direct, indirect or virtual) ofclassinfo
.
You can use issubclass()
like this assert issubclass(suit, Suit)
.