问题:方法中如何调用另一个类中__call__方法?
方法:
class foo(object):
def __init__(self):
self.name = 'python'
def __call__(self, *args, **kwargs):
print('hello%s'%self.name)
def run():
instance = foo()
instance()
a = instance
print dir(a)
参考:
https://blog.csdn.net/qq_21583139/article/details/119720698