1.类型的类型
所有类型对象的类型都是type。它也是所有Python类型的根和所有Python标准类的默认元类(metaclass)。
>>> type(2)
<class 'int'>
>>> type(type(2))
<class 'type'>
>>> type(int)
<class 'type'>
>>> 2.None,Python的Null对象
本文介绍了Python中所有类型的根源——type类型,并展示了如何通过type()函数检查任意对象的类型。此外,还解释了Python中的特殊值None及其用途。
1.类型的类型
所有类型对象的类型都是type。它也是所有Python类型的根和所有Python标准类的默认元类(metaclass)。
>>> type(2)
<class 'int'>
>>> type(type(2))
<class 'type'>
>>> type(int)
<class 'type'>
>>>

被折叠的 条评论
为什么被折叠?