1、isintance(a,A) 判断a是否是A的对象
class A():
pass
a = A()
print(isinstance(a,A))
2、issubclass(sub,supper)检查 sub是不是supper的派生类,也就是sub是不是supper的子类
class A():
pass
class B(A):
pass
print(issubclass(B,A))
2022-05-14 17:31:27
class A():
pass
a = A()
print(isinstance(a,A))
class A():
pass
class B(A):
pass
print(issubclass(B,A))