isinstance isinstance(object, classinfo) 判断实例是否是这个类或者object是变量 classinfo 是类型(tuple,dict,int,float,bool,complex,str,list,set) 判断变量是否是这个类型 class objA: pass A = objA() B = 'a','v' C = 'a string' print isinstance(A, objA) print isinstance(B, tuple) print