In the previous chapter, we gave a brief introduction to the C3 linearization algorithm. You can calculate it manually or use the built-in .mro() method on a class to inspect its Method Resolution Order (MRO). In this chapter, we’ll follow the trail of the .mro() method and see how this algorithm is implemented in CPython.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

The Role of super() in Multiple Inheritance

  • Chien-Lung Kao

摘要

In the previous chapter, we gave a brief introduction to the C3 linearization algorithm. You can calculate it manually or use the built-in .mro() method on a class to inspect its Method Resolution Order (MRO). In this chapter, we’ll follow the trail of the .mro() method and see how this algorithm is implemented in CPython.