擅长:python、mysql、java
<pre><code> >>> print(x(2)) # works in 2.7
3
>>> type(x)
<class '__main__.CallableList'>
>>> y = [1,2,3]
>>> type(y)
<type 'list'>
</code></pre>
<p>所以您并没有真正地重新定义类型“list”,您只更改了名称空间,使type list的list()方法现在与您的类型CallableList类型发生冲突。为了避免这种情况</p>
^{pr2}$