isinstance()
函数格式:
isinstance(object, classinfo)
判断实例/object是否属于这个类,classinfo
包括(tuple, dict, int, float)
举例:
>>> class obj():
pass
>>> A = obj()
>>> print isinstance(A, obj)
True
isinstance()
函数格式:
isinstance(object, classinfo)
判断实例/object是否属于这个类,classinfo
包括(tuple, dict, int, float)
举例:
>>> class obj():
pass
>>> A = obj()
>>> print isinstance(A, obj)
True