📜  python 为什么调用 super(class).__init__() - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:18.118000             🧑  作者: Mango

代码示例1
super() lets you avoid referring to the base class explicitly, 
which can be nice. 
But the main advantage comes with multiple inheritance.
Note that the syntax changed in Python 3.0: you can just say super().__init__()
instead of super(ChildB, self).__init__() which IMO is quite a bit nicer.