__call__

时间:2020-12-18 12:30:38   收藏:0   阅读:2
# __author: "ZXYang"
# date: 2020/12/13


class MyTest():

def __call__(self, *args, **kwargs):
print("__call__方法")


m = MyTest()
m()
# __call__方法: m()可直接 【加()】调用对象
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!