判断是否 他的父类
class Foo(object): pass obj = Foo() class Boo(Foo): pass class Coo(Boo): pass obj = Boo() print(issubclass(Boo, Foo)) print(issubclass(Boo, Coo)) ''' True False '''
判断是否 他的父类
class Foo(object): pass obj = Foo() class Boo(Foo): pass class Coo(Boo): pass obj = Boo() print(issubclass(Boo, Foo)) print(issubclass(Boo, Coo)) ''' True False '''