最佳答案
                                        
                                                                        
                                为什么 Python 不允许模块使用 __call__方法?(除了显然不容易直接进口之外。)具体来说,为什么使用 a(b)语法不能像查找函数、类和对象那样查找 __call__属性?(对于模块来说,查找是否只是不兼容而已?)
>>> print(open("mod_call.py").read())
def __call__():
return 42
>>> import mod_call
>>> mod_call()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable
>>> mod_call.__call__()
42