你可以通过内置函数“issubclass()”检查类的继承关系:
# You can check for class
# inheritance relationships
# with the "issubclass()" built-in:
>>> class BaseClass: pass
>>> class SubClass(BaseClass): pass
>>> issubclass(SubClass, BaseClass)
True
>>> issubclass(SubClass, object)
True
>>> issubclass(BaseClass, SubClass)
False