
On Sat, Mar 26, 2022 at 10:50 AM malmiteria <martin.milon@ensc.fr> wrote:
why does it have to be automatic?
because that's the entire point of super() -- if you don't want automatic, do what you want by making direct method calls.
if they think one is more specialized than the other, they make one inherit from the other, they don't set them both as parent of a third.
I think the best use case for multiple inheritance is mixins -- which do have a natural order -- as you say, in other cases, you can do single inheritance.
Tho, to make it clear, i've no doubt it's doable without super today. My point is that MRO as it is, has some flaws.
Also, super() actually calls the method on all the superclasses (but not the same one twice) -- so that right to left thing doesn't matter. It does matter with regular calling of methods, though, but you need SOME rule there. -CHB
Also, Eventual hierarchy where the rule won't fit are simply not allowed today, no matter your use of super. take this one for example : ``` class A(X, Y): pass class B(Y, X): pass class C(A, B): pass ```
This code fails, you can overcome it through composition, but nevertheless, this doesn't justify this problem. Essentially it's a case of "this is broken, but something else close enough isn't". It works, but it's still broken
Oh and just to make it more explicit, MRO and super are two different concern of mine here. They could be addressed separately, but since those feature are related, i felt like sharing it in one post _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@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/NH5JOZ... Code of Conduct: http://python.org/psf/codeofconduct/
-- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython