Which algorithm does Python 3 use to compute the method resolution order (MRO) for multiple inheritance?
Correct answer B. C3 linearisation
Explanation
Since Python 2.3, new-style classes use the C3 linearisation algorithm, which preserves the local order of base classes and guarantees that a class appears before its parents. A simple depth-first search could visit a shared base before all its subclasses, which C3 prevents. The result is available as Class.__mro__.
Answer checked How we write and check questions
Discussion