class Car:
price = 100000 #定义类属性
def __init__(self, c):
self.color = c #定义实例属性
print("__init__")
def __call__(self):
print("__call__")
c = Car(4)
c() # __call__
Python小记——__call__方法
猜你喜欢
转载自blog.csdn.net/weixin_39541632/article/details/102931560
今日推荐
周排行