Python cooperative inheritance: How super() walks the MRO

Python cooperative inheritance: How super() walks the MRO

Some Python rules for inheritance:

– Use super().x() to find the next class with a method “x”
– “Next” is defined on the instance, aka type(self).__mro__
– Every ancestor class should also use super().x()
– This allows multiple parents’ x() methods to run