What is Python's super() in multiple inheritance?
Why Interviewers Ask This
Mid-level Python roles require deep understanding of this topic. Interviewers ask this to separate candidates who truly understand the mechanics from those who only know surface-level concepts.
Answer
In multiple inheritance, super() does not simply call the immediate parent class — it follows the MRO (Method Resolution Order) and calls the next class in the MRO chain. This enables cooperative multiple inheritance. Example with diamond inheritance: class A: def method(self): print("A"); class B(A): def method(self): super().method(); print("B"); class C(A): def method(self): super().method(); print("C"); class D(B, C): def method(self): super().method(); print("D"). Calling D().method() prints A, C, B, D — following D→B→C→A MRO. For cooperative MI to work, all classes in the hierarchy must call super(). Arguments must also be consistent throughout the chain — use *args, **kwargs for forward-compatible cooperative methods. This pattern is common in mixin-based frameworks like Django class-based views.
Pro Tip
Back up your answer with a specific project or situation. Saying 'In my last Python project, I used this when...' immediately makes your answer more credible and memorable.