且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Python 中访问超类的类属性?

更新时间:2023-11-24 22:45:40

问题的第二次编辑中提出的解决方案仍然是唯一提供我的应用程序所需的一切的解决方案.虽然 unutbu 的代码可能更容易理解,但 __mro__ 解决方案为 IMO 提供了一些优势(见评论).

The solution proposed in the second edit of the question is still the only one that provides everything my application requires. While unutbu's code might be simpler to understand, the __mro__ solution provides some advantages IMO (see comments).