title: Override a "private" method in Python
body: <p>Consider a class with a &quot;private&quot; method such as:</p>
  <pre><code>class Foo(object):
      def __init__(self):
          self.__method()
      def __method(self):
          print('42')
  </code></pre>
  <p>When I try to subclass <code>Foo</code> and override method <code>__method</code>, it can be seen that <code>Foo.__method</code> is still called, instead of <code>MoreFoo.__method</code>.</p>
  <pre><code>class MoreFoo(Foo):
      def __method(self):
          print('41')
  
  &gt;&gt;&gt; MoreFoo()
  42
  &lt;__main__.MoreFoo object at 0x7fb726197d90&gt;
  </code></pre>
  <p>What would be the way to override such a method?</p>