> To me it doesn't seem reasonable that someone would inherit from two 
> classes and want to call a method from one without even knowing that 
> there's a method name collision.  If you're going to inherit from A and 
> B, you need to know what methods they provide and you need to think 
> about the order you inherit in.

Well i guess you've never been new to django, or so many ORMs
You most definitely *don't* know about all the method you inherit from
And the order you inherit in is final for the class
Why would this be the order you wanna call all the methods provided by the 
parents?
It seems possible that for some method, the wanted order won't be the same all 
throughout the class.

And as much as class.method allows to pick and choose the parent you're calling 
it from, if on top of that you actually need to call both parents method in a 
specific order, they better not make use of super, otherwise, the second 
class.method will redo most of what the first did.
This is a case that doesn't have nice solution now, i think. (Again, please 
challenge me, i'm just one mind)

> Based on your example, I still don't really see the advantage of your 
> proposal.  Currently super is the way to say "let Python choose for me 
> what method implementation to call next, based on the class hierarchy". 
> You seem to be saying that in some cases that won't call the right 
> thing so you don't want it to call anything.  But if super doesn't call 
> the right thing, you can just not use super and instead explicitly call 
> the method you want, so I don't get what this proposal gains.

I disagree, I think most people when they use super are just saying, call the 
parent method, since that's what it visibly does in simple inheritance, and 
that's what most people will face in their programming lives.
The problem still relies on MRO in the end, which is the thing that needs 
reworking the most:
My point is that : it is not correct to assume it is meaningful to give an 
order to multiple inheritence

It make sense to say a child is more specific than its parents, because that's 
literraly what inheritance is, but saying that parent 1 is more specific than 
parent 2 is... weird to say the least.

And my proposal explicitely *doesn't* order them. Please re read the list of 
features i proposed for the alternative to MRO
It is very similar to MRO in cases there's no conflict, but simply raises an 
error in case there's a conflict.

Now, since i change MRO and super relies on MRO, i have to produce an 
alternative to super to, and given my alternative to MRO, my alternative to 
super *has* to be passed as an argument which parent it refers to, but that's 
almost just an after thought
_______________________________________________
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/SJQNOF2OJJDLXYWAQTXT452KEKWDIAXH/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to