QUESTION 6 OF 10

How does Python resolve methods in multiple inheritance?

Reveal the answer and explore the explanation.

06
HardHigh priority

How does Python resolve methods in multiple inheritance?

Answer
Answer

Python uses C3 linearization to compute a consistent class ordering; super follows that ordering.

Practical example

Inspect Class.__mro__ when a method is inherited from multiple parents.

Reference: Further reading ↗

Last 30 min revisionHigh-yield interview Q&As