# __call__函数的使用, 将类带有函数属性的功能
class Student(object):
def __init__(self):
self.name = "oliver"
def __call__(self):
print(self.name)
stu = Student()
stu()
Python3 __call__函数的使用
猜你喜欢
转载自blog.csdn.net/weixin_43690548/article/details/88861312
今日推荐
周排行