Method names beginning with double underscores are automatically distorted; internally, the _ClassName string _ClassName appended to the method name:
>>> class Foo(object): ... def __bar(self): ... pass ... >>> Foo.__dict__.keys() ['__dict__', '__module__', '__weakref__', '__doc__', '_Foo__bar']
This renaming is also done for anything that references this method name in any of the other methods in the class.
Thus, your __dispatch() method is renamed to _Parent__dispatch() , and the dispatch() method is changed to call self._Parent__dispatch() . Similarly, your Child class has the _Child__dispatch() method, and therefore it does not override the _Parent__dispatch() method of this superclass.
That is why you see the results that you see; rename the __dispatch() methods to _dispatch() (only one underscore) and it will work as expected.
Why does python do this? This is a form of providing private attributes and methods that cannot be accidentally overridden by classes that inherit from them. See the personal name mangling in the expression reference for Python.
The Python style guide for PEP 8 talks about managing a private name:
If your class is intended to be a subclass and you have attributes that you do not want to use subclasses, consider their double leading underscores and the absence of underscores. This calls the Python Name Rename Algorithm, where the class name is mutilated into the attribute name. This helps to avoid a collision attribute name should subclasses inadvertently contain attributes with the same name.
Note 1: Note that only the simple name of the class name is used in the distorted one, therefore, if a subclass selects the same class name and attribute name, you can still get name clashes.
Note 2: Changing the name may make certain uses, such as debugging and __getattr__() , less convenient. However, the name determination algorithm is well-documented and easy to execute manually.
Note 3: Not everyone likes name manipulation. Try to balance the need to avoid accidental name conflicts with the potential use of advanced subscribers.