I have two parent classes that share method names. I’d like to subclass them and reassign their methods under different names to the subclass. This is made complicated because these methods use other methods with shared names as well. Contrived but minimal example: In the example above, foo.print1() prints 1 as expected, but foo.print2() prints 1 instead of 2. I
Tag: method-resolution-order
Why is “Y” printed instead of “X” in this MRO?
Could somebody explain why this code prints Y and not X? I expected it to print “X” because it says pass in Class C and Class X is the next super class. Sorry for the long code, but I dont know how to make it shorter without making the question unclear Answer Per Python Multiple Inheritance: The Diamond Rule: List