后来的六六

关注

Python小记——__call__方法

后来的六六

关注

阅读 50

2022-06-21

class Car:
price = 100000 #定义类属性
def __init__(self, c):
self.color = c #定义实例属性
print("__init__")
def __call__(self):
print("__call__")

c = Car(4)
c() # __call__


相关推荐

GhostInMatrix

python的__call__方法使用

GhostInMatrix 65 0 0

向上的萝卜白菜

python魔术方法__call__的研究

向上的萝卜白菜 87 0 0

雪域迷影

Python3中__call__方法介绍

雪域迷影 51 0 0

sunflower821

python类中的 __call__()方法运用

sunflower821 91 0 0

color_小浣熊

python小点心--__call__

color_小浣熊 100 0 0

鱼满舱

深入解析 Python 的 __call__() 方法与可调用对象

鱼满舱 10 0 0

Resin_Wu

python中__init__和__call__的区别

Resin_Wu 97 0 0

雪域迷影

FastAPI 深入学习:利用__call__方法实现动态依赖项

雪域迷影 28 0 0

日月同辉9908

python中__init__、__getattr__、__setattr__、__call__的使用

日月同辉9908 47 0 0

Java旺

python中的__new__, __init__和__call__函数用法详解

Java旺 73 0 0

精彩评论(0)

0 0 举报