Inheritance of parent classes in Python

About the use of the super() function

The super() function is a method used to call the parent class (super class).

super() is used to solve the problem of multiple inheritance. Directly using the class name to call the parent class method is no problem when using single inheritance, but if you use multiple inheritance, it will involve search order (MRO) and repeated calls (diamond inheritance) and other issues.

Guess you like

Origin blog.csdn.net/Alex497259/article/details/124123122