Typefully

Understanding Python's Method Resolution Order

Avatar

Share

 • 

A year ago

 • 

View on X

Python supports multiple inheritance i.e. one class can inherit from multiple classes This leads to a problem when both parents implement same method & child get's confused which parent classes method it should call This is where Method Resolution Order (MRO) comes into picture
• Method Resolution Order describes a clear order in which a child class will look for methods in the hierarchy • MRO can be accessed using __mro__ or mro() • MRO helps developers write maintainable and understandable code when dealing with complex class hierarchies
If you prefer learning about MRO in video format checkout my YT video about the same youtu.be/EcIMnwOTiTA?si=v5shxJNRjfyjpDV6
Avatar

Jaydeep

@_jaydeepkarale

Follow Me If You Like 🐍 Python 🤖 Machine Learning/AI ⚙️ Software Engineering 📊 Data Visualization 📩 DM For Collab youtube.com/@jaydeepkarale