摘要:
Python内建函数type(object),用于返回当前object对象的类型。例如:>>> type(1)<type 'int'>>>> type("1")<type 'str'>types模块定义了python中所有的类型,包括NoneType, TypeType, ObjectType....types模块所在的位置为{%PYTHONPATH%\lib\types.py}.实现方法很简单,把对应的类型赋值给变量:NoneType = type(None)TypeType = 阅读全文