inheritance searches listtree before super which class would we inherit it from--listtree or superas inheritance searches proceed from left to rightwe would get the method from whichever class is listed first (leftmostin sub' class header presumablywe would list listtree first because its whole purpose is its custom __str__ (indeedwe had to do this in when mixing this class with tkinter button that had __str__ of its ownbut now suppose super and listtree have their own versions of other same-named attributestoo if we want one name from super and another from listtreethe order in which we list them in the class header won' help--we will have to override inheritance by manually assigning to the attribute name in the sub classclass listtreedef __str__(self)def other(self)class superdef __str__(self)def other(self)class sub(listtreesuper)other super other def __init__(self)get listtree' __str__ by listing it first but explicitly pick super' version of other sub(inheritance searches sub before listtree/super herethe assignment to other within the sub class creates sub other-- reference back to the super other object because it is lower in the treesub other effectively hides listtree otherthe attribute that the inheritance search would normally find similarlyif we listed super first in the class header to pick up its otherwe would need to select listtree' method explicitlyclass sub(superlisttree)__str__ lister __str__ get super' other by order explicitly pick lister __str__ multiple inheritance is an advanced tool even if you understood the last paragraphit' still good idea to use it sparingly and carefully otherwisethe meaning of name may come to depend on the order in which classes are mixed in an arbitrarily farremoved subclass (for another example of the technique shown here in actionsee the discussion of explicit conflict resolution in "the 'new-styleclass model"as well as the earlier super coverage as rule of thumbmultiple inheritance works best when your mix-in classes are as self-contained as possible--because they may be used in variety of contextsthey should not make assumptions about names related to other classes in tree the pseudoprivate __x attributes feature we studied in can help by localizing names that class relies on owning and limiting the names that your mix-in classes add to the mix in this examplefor instanceif listtree only means to export its custom class gotchas