title: Why can't subclasses override 'private' base method in Python?
body: <p>I'm currently stunned by some Python behavior:</p>
  
  <pre><code>class Base(object):
      def foo(self):
          self.__virtual_function()
          self.virtual_function()
      def __virtual_function(self):
          print("private Base")
      def virtual_function(self):
          print("public Base")
  
  class Derived(Base):
      def __virtual_function(self):
          print("private Derived")
      def virtual_function(self):
          print("public Derived")
  
  d = Derived()
  d.foo()
  </code></pre>
  
  <p>This prints</p>
  
  <pre><code>private Base
  public Derived
  </code></pre>
  
  <p>Is the double underscore <em>effectively</em> making a method private, and thus not overridable by subclasses?</p>