📜  def __init__ python 不覆盖父类 - Python 代码示例

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

代码示例1
# You must call __init__ for each parent class. 
# The same goes for functions, if you are overriding a function 
# that exists in both parents.

class Child(Parent):
    def __init__(self):
        Parent.__init__(self)