判斷對象是不是元組:函數
isinstance(val, types.TupleType)ui
或spa
types.TupleType == type(val)code
判斷是不是函數:對象
isinstance(func, types.FunctionType)ip
須要引入types模板,獲取數據類型:io
inport types模板
types取值:List
BooleanType
BufferType
BuiltinFunctionType
BuiltinMethodType
ClassType
CodeType
ComplexType
DictProxyType
DictType
DictionaryType
EllipsisType
FileType
FloatType
FrameType
FunctionType
GeneratorType
GetSetDescriptorType
InstanceType
IntType
LambdaType
ListType
LongType
MemberDescriptorType
MethodType
ModuleType
NoneType
NotImplementedType
ObjectType
SliceType
StringType
StringTypes
TracebackType
TupleType
TypeType
UnboundMethodType
UnicodeType
XRangeType數據類型