标签:src strong bsp copy subclass div title str 派生类
isinstance(obj,cls)检查是否obj是否是类 cls 的对象
1 class Foo(object): 2 pass 3 4 obj = Foo() 5 6 isinstance(obj, Foo)
issubclass(sub, super)检查sub类是否是 super 类的派生类
1 class Foo(object): 2 pass 3 4 class Bar(Foo): 5 pass 6 7 issubclass(Bar, Foo)
标签:src strong bsp copy subclass div title str 派生类
原文地址:https://www.cnblogs.com/Manuel/p/12863571.html