What is Python’s Method Resolution Order (MRO) and what algorithm computes it?

Python Developer Hard

Python Developer — Hard

What is Python’s Method Resolution Order (MRO) and what algorithm computes it?

Key points

  • MRO determines the order of attribute/method lookup in multiple inheritance
  • C3 linearization algorithm computes the MRO
  • Ensures each class comes before its parents
  • Preserves the order of base classes in the class definition

Ready to go further?

Related questions