class A: def __init__(self): print("world") class B(A): def __init__(self): print("hello") B() # output: hello
在我使用超级构造函数的所有其他语言中隐式调用.如何在Python中调用它?我希望,super(self)但这不起作用.
super(self)
python inheritance constructor class superclass
class ×1
constructor ×1
inheritance ×1
python ×1
superclass ×1