Good Reads on Python's MRO

Posted Sun Feb 10 @ 01:26:12 PM PDT 2013

I started using Python regularly about 4 years ago, and I'm a huge fan. But even after 4 years, I find there is still a ton of stuff I don't know about the language. I was recently experimenting with Django's class based views. I decided I won't be using them for a lot of reasons. But I still wanted to know how they work.

Class based views make heavy use of multiple inheritance, which is something I've never had to use in any Python code I've ever written. Multiple inheritance is confusing from the programmer's perspective, and it's hard to implement correctly in a language. The BDFL, Guido van Rossum, himself couldn't get it right the first 2 times.

There is a ton of stuff written on Python multiple inheritance, and the method resolution order. The two pieces that helped me the most were:

<< Home