September 2022
Intermediate to advanced
402 pages
7h 28m
English
In this chapter, we will look at the concept of method resolution order (MRO) in Python 3 and how it works on inheritance.
As the name suggests, MRO is the order in which methods of a class get resolved while calling them in a program.
Throughout this chapter, we will look at understanding the MRO through a few examples, how method resolution can go wrong, and how the current Python 3 implementation handles methods defined in a class. We will be making use of MRO throughout this chapter to understand the behavior of code while inheritance is implemented in Python 3.
Why should we understand MRO? In scenarios where we are using multiple classes in Python code, we need to inherit ...
Read now
Unlock full access