擅长:python、mysql、java
<p>它记录在<a href="http://docs.python.org/2/reference/datamodel.html#the-standard-type-hierarchy" rel="nofollow">Data model</a>,“类实例”一节中:</p>
<blockquote>
<p>Attribute assignments and deletions update the instance’s dictionary,
never a class’s dictionary. <strong>If the class</strong> has a <code>__setattr__()</code> or
<code>__delattr__()</code> method, this is called instead of updating the instance dictionary directly.</p>
</blockquote>
<p>因此,无论是旧样式还是新样式,这两个检查总是针对类型,而不是实例。在</p>