擅长:python、mysql、java
<p>CPython不允许这样:</p>
<pre><code>TypeError: can't set attributes of built-in/extension type 'function'
</code></pre>
<p>(如果您尝试使用<code>.__dict__</code>方法…)</p>
<pre><code>TypeError: 'dictproxy' object does not support item assignment
</code></pre>
<p>这是因为这些类型是用C语言实现的,以灵活性换取速度。你知道吗</p>