Python·100 questions

How do inheritance and super() work?

Answer
class Child(Parent): ...
super() calls methods of the base class according to MRO.
In multiple inheritance, MRO is critical.
Always use super() in cooperative classes.
Check MRO: Class.mro().
Was this answer helpful?

More questions in this topic

Related questions from other topics