On Sun, Apr 10, 2022 at 11:50:40AM -0700, Brendan Barnwell wrote: > You seem to be envisioning a system in which multiple inheritance > gives a subclass a "menu" of behaviors from which it may explicitly > choose, > but does not actually combine the superclasses' behaviors into a single, > definite behavior of the subclass. In that scheme, order of multiple > inheritance would not matter, because the superclasses don't need to be > "integrated" into the subclass; they just sit there waiting for the > subclass to explicitly decide which superclass it wants to delegate to.
Thanks Brendan, that has helped me understand where malmiteria is coming from. I think that your comments explains a lot of his ideas about MI. > Maybe that's how MI works in some other languages, but not Python. > Everything about a class --- super, MRO, everything --- is impacted by > its ENTIRE superclass hierarchy, including the order in which classes > are inherited. When a subclass inherits from multiple superclasses, the > superclass behaviors are *combined* into a *single* set of behaviors for > the subclass. They're not "held separate" somehow as alternative > inheritance hierarchies; they are joined into one. +1 > Likewise, the order in which a class inherits multiple superclasses > matters in Python. That's just how Python works, and there's no way > that's going to change. I don't want to sound harsh, but if `class A(B, > C)` doesn't "feel" different to you from `class(C, B)` then I think you > need to adjust your feelings rather than expect Python to adjust its > behavior. And +1 to that too. -- Steve _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/Q7PLWUGJLWVDEFOGX6AMEBSKK3AGACRT/ Code of Conduct: http://python.org/psf/codeofconduct/