
On Sat, Apr 16, 2022 at 11:07:00AM +1000, Chris Angelico wrote:
On Sat, 16 Apr 2022 at 11:00, Steven D'Aprano <steve@pearwood.info> wrote:
and therefore would become the only thing that offers "full MI", displacing other languages. It's a meaningless concept, unless there is some form of absolute completeness that can be attained
Well duh Chris, sometimes I wonder if you read my posts before jumping in to disagree with me, that is *exactly* what I am arguing.
You placed a LOT of caveats on it. I don't count that as "absolute completeness". It is the most complete that YOU, right now, think could ever be possible.
Which conditions would you drop? There's not that many, really. Five. Six if you include the "no cycles" requirement for the DAG, which I think is so obviously necessary that it is barely worth mentioning. The most subjective is the requirement for automatic conflict resolution. It is a legitimate design choice to give up automatic conflict resolution (that's what C++ and Eiffel do) but that would be a breaking change for Python. So come on Chris, back up your disagreement with something objective, not just wishy-washy "anything might happen in the future!" nonsense. No, not everything is possible. We're never going to discover a new odd number between 3 and 5, or that 7 isn't really prime, or that cats are actually a type of plant, or that Australia doesn't exist. So be concrete: which of my preconditions do you want to challenge? - The inheritance model automatically resolves conflicts. As I said, it is a legitimate design choice to give that up, but it would be a breaking change for Python so we can rule it out. In any case, languages without automatic conflict resolution do less than languages with them. (That might be a good thing.) - The MRO is entirely dependendent on the shape of the inheritance graph, and not on incidental properties like the name of classes. Let's hear your justification for why breaking that condition is good. "I changed my class name from Spam to Eggs, and suddenly the inheritance relationships between my classes changed." "That's not a bug, that's a feature!!!" - the inheritance model is consistent, monotonic and preserves local precedence order (C3 linearization). Which of those three will you give up, and why is that a good thing? "In my class Spam, superclass A takes precedence over B, but when I subclass Spam, the precedence swaps and B comes before A." "That's not a bug, that's a feature!!!"
If you exclude models of MI which are logically incoherent and inconsistent, (such as Python's prior to version 2.3), then Python's model of MI is objectively as complete as you can get.
If you assume that what we know in 2022 is the most we will ever know, then yes, you would be correct. Do you really think that nobody will ever learn anything new about ways of doing MI?
Yes. Its a DAG of superclass/subclass relationships. There is only one way to draw that graph that is coherent. This is like sorting. Of course people can develop new and faster sort algorithms which use less memory, but nobody is going to discover that all the old sort algorithms are wrong and 5 should come before 2. We might discover better algorithms for linearizing the superclasses, we might even discover a bug in the C3 algorithm. But we aren't going to discover that having your inheritance relationships flip order when you subclass is good, or that the order of linearization should depend on the time of day, or that violating local precedence is a good thing.
I don't know whether you're mistaken or utterly arrogant.
Do you think they are the only two choices? Are you such a contrarian that you refuse to even consider that I might be right? I have never claimed to be omniscient. Of course I could be wrong. I may have been mislead, or misunderstood the state of the art. If you have something more than just wishful thinking about what "might" be discovered in the future, please tell me. I welcome corrections which are objective and based on proven facts. -- Steve