二哥啊

导航

 
def foo(x):
print(x)

print(foo.__dict__)
print(foo.__call__)
print(dir(foo))

class A:
def __call__(self, *args, **kwargs):
print(5)

A()() #调用实例的call方法
a= A()
a(3,4)
posted on 2019-09-03 20:53  二哥啊  阅读(151)  评论(0编辑  收藏  举报