擅长:python、mysql、java
<p>在Python中,甚至类都是对象,每个对象都是类的实例。<code>Person</code>引用“类对象”,它是<code>type</code>的一个实例。在本例中,有一个元类在play-highly-flusing metaprogramming magic中,但是如果您需要介绍,请参见<a href="https://stackoverflow.com/questions/100003/what-is-a-metaclass-in-python">What is a metaclass in Python?</a>。如果您声明一个<code>class Foo(object)</code>,<code>Foo.__class__ is type</code>(对于不从对象继承的旧式类来说,情况有所不同,更加令人困惑)。顺便说一句,这导致更奇怪的是{<cd2>}似乎是它自己的一个实例。在</p>