![](https://secure.gravatar.com/avatar/0260d0b125bbd58619446b67b86f3af2.jpg?s=120&d=mm&r=g)
Steven D'Aprano writes:
How else are you going to get inheritance without a linear order? The interpreter can only call superclass methods one at a time, in some linear order.
The whole point of inheritance is that (to the degree that it is
You can decide what method should be the one resolved to *after* visiting all superclass methods. I've already implemented it here, it's a "simple" recursion (no recursion is ever simple xD): https://github.com/malmiteria/super-alternative-to-super/blob/59ff90029db6e4... Essentially, as long as parent don't have it, you keep looking higher in the inheritance tree, either you find no such method, and you raise an AttributeError, if you found it only once, you return it, and if you found multiple, you raise the ExplicitResolutionRequired error. The order in which you visited the parent is irrelevant to the result, what matters is only to stop exploring a branch when it ends, or when you found the method. Each parent is looked up in its own branch, independantly of any other branches. The end result is absolutely not affected by the order in which you've explored those branches -- possible) we should not explicitly care about where the methods are defined Agreed. My solution doesn't require you to be explicit about where a method is defined. It only eventually raises an error in case of collision, which you can resolve by redefining the method in the child class, only if you intend on calling it (not calling a method that would raise an error is fine with my solution, whereas current MRO + super fails at class definition time no matter your use of that class). my __as_parent__ allows to explicitely call each one of the parents method individually wherever it matters to you --
If you do want to explicitly specify where the methods are defined
I don't, at least that's not what my solution is for / requires you to do. --
If you want to manage your "inheritance" manually by specifying the order, then just don't use automatic inheritance
That's what i have to resolve to today yeah. The feature has its limits, working around it is painful, that's why i'm proposing this change to the language