class Test:
def __init__(self):
self.count = 1
#只要实现了__call__函数,就支持对象作为函数调用!
def __call__(self, *args, **kwargs):
print(args);
print(kwargs);
test = Test()
#test是一个对象,可以自动作为函数调用!
test(123,a=345)
#输出结果为:(123,) {'a': 345}