只有在类型上而不是在实例上定义特殊方法时,才保证可以隐式调用它们。(
__call__是模块实例的属性
mod_call,而不是的属性
<type'module'>。)不能将方法添加到内置类型中。
https://docs.python.org/reference/datamodel.html#special-
lookup

只有在类型上而不是在实例上定义特殊方法时,才保证可以隐式调用它们。(
__call__是模块实例的属性
mod_call,而不是的属性
<type'module'>。)不能将方法添加到内置类型中。
https://docs.python.org/reference/datamodel.html#special-
lookup