Force child class to call parent method when overriding it

后端 未结 7 1943
梦谈多话
梦谈多话 2020-12-15 16:05

I am curious whether there is a way in Python to force (from the Parent class) for a parent method to be called from a child class when it is being overridden.

Examp

7条回答
  •  长情又很酷
    2020-12-15 16:48

    However, is there a way to force developers that develop Child classes to specifically call(not just override) the 'start' method defined in the Parent class in case they forget to call it

    In Python you can not control how others override your functions.

提交回复
热议问题