for most purposesin the simplest casesyou can think of the search for attributes inherited from parent class as depth-firstleft-to-rightnot searching twice in the same class where there is an overlap in the hierarchy thusif an attribute is not found in derivedclassnameit is searched for in base then (recursivelyin the base classes of base and if it was not found thereit was searched for in base and so on in factit is slightly more complex than thatthe method resolution order changes dynamically to support cooperative calls to super(this approach is known in some other multiple-inheritance languages as call-next-method and is more powerful than the super call found in single-inheritance languages dynamic ordering is necessary because all cases of multiple inheritance exhibit one or more diamond relationships (where at least one of the parent classes can be accessed through multiple paths from the bottommost classfor exampleall classes inherit from objectso any case of multiple inheritance provides more than one path to reach object to keep the base classes from being accessed more than oncethe dynamic algorithm linearizes the search order in way that preserves the left-to-right ordering specified in each classthat calls each parent only onceand that is monotonic (meaning that class can be subclassed without affecting the precedence order of its parentstaken togetherthese properties make it possible to design reliable and extensible classes with multiple inheritance for more detailsee private variables "privateinstance variables that cannot be accessed except from inside an object don' exist in python howeverthere is convention that is followed by most python codea name prefixed with an underscore ( _spamshould be treated as non-public part of the api (whether it is functiona method or data memberit should be considered an implementation detail and subject to change without notice since there is valid use-case for class-private members (namely to avoid name clashes of names with names defined by subclasses)there is limited support for such mechanismcalled name mangling any identifier of the form __spam (at least two leading underscoresat most one trailing underscoreis textually replaced with _classname__spamwhere classname is the current class name with leading underscore(sstripped this mangling is done without regard to the syntactic position of the identifieras long as it occurs within the definition of class name mangling is helpful for letting subclasses override methods without breaking intraclass method calls for exampleclass mappingdef __init__(selfiterable)self items_list [self __update(iterabledef update(selfiterable)for item in iterableself items_list append(item__update update private copy of original update(method class mappingsubclass(mapping)def update(selfkeysvalues)provides new signature for update(but does not break __init__(for item in zip(keysvalues)self items_list append(itemnote that the mangling rules are designed mostly to avoid accidentsit still is possible to access or modify variable that is considered private this can even be useful in special circumstancessuch as in the debugger classes