Author jeff.allen
Recipients bmvanwyk, jeff.allen, tomluk, wfouche2, zyasoft
Date 2019-04-14.07:07:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
It looks like I have to understand this after all. Here are some initial thoughts.

Having read a bit (, (, Barrett 1996, (, my first question-to-self is why we are using C3 to resolve the MRO of classes defined in Java.

A class defined in Python having Java bases should use C3 at that step, but here we are tripping over a class validly defined in Java. In addressing the merge for, we attempt to merge these lists:

[javax.jms.Queue, javax.jms.Destination, java.lang.Object, object]

[,,,,, java.util.Map, javax.jms.Queue, javax.jms.Destination, java.lang.Object, object]

[,,, javax.naming.Referenceable,,,,,,,,, java.util.Map, javax.jms.Destination, java.lang.Object, object]


The last of these is the bases of and the first 3 are the MROs of these bases. Each of the list heads is in one of the list tails, and so C3 falls at the first hurdle.

Java allows multiple inheritance from interfaces, but the resolution strategy is not C3. Ordering of bases is (I think) irrelevant, since at most one ancestor can bring an implementation. The exception to this (that I know about) relates to constants. Constants of the same name can have conflicting definitions by inheritance from interfaces. Python would decide which one wins using order: Java would make it illegal to use the ambiguous name (at compile time).

If Java is insensitive to the ordering of bases, complex heterarchies defined in Java will surely turn up a lot of examples that Java has allowed but C3 rejects. Shouldn't we be using Java rules for Java classes?

Also, I really don't see why, if the problem is that the *classes* can't be merged by C3, a solution should be sought in the examination of particular clashing *attributes*. When we find such a clash, it appears we force our MRO to accept a candidate C3 would not, then continue from there. This forcing obviously moves us towards termination, but I don't see the logic of the particular choice.
Date User Action Args
2019-04-14 07:07:54jeff.allensetmessageid: <>
2019-04-14 07:07:54jeff.allensetrecipients: + jeff.allen, zyasoft, tomluk, bmvanwyk, wfouche2
2019-04-14 07:07:54jeff.allenlinkissue2445 messages
2019-04-14 07:07:53jeff.allencreate