title: calling an overridden method from base class?
body: <p><a href="http://diveintopython.net/object_oriented_framework/userdict.html" rel="noreferrer">Dive into Python</a> - </p>
  
  <blockquote>
    <p>Guido, the original author of Python, explains method overriding this way: "Derived classes may override methods of their base classes. Because methods have no special privileges when calling other methods of the same object, a method of a base class that calls another method defined in the same base class, may in fact end up calling a method of a derived class that overrides it. (For C++ programmers: all methods in Python are effectively virtual.)" If that doesn't make sense to you (it confuses the hell out of me), feel free to ignore it. I just thought I'd pass it along.</p>
  </blockquote>
  
  <p>I am trying to figure out an example for: <em>a method of a base class that calls another method defined in the same base class, may in fact end up calling a method of a derived class that overrides it</em></p>
  
  <pre><code>class A:      
    def foo(self): print 'A.foo'      
    def bar(self): self.foo()                  
  
  class B(A):      
    def foo(self): print 'B.foo'     
  
  if __name__ == '__main__': 
    a = A()                
    a.bar()                   # echoes A.foo
    b = B()
    b.bar()                   # echoes B.foo
  </code></pre>
  
  <p>... but both of these seem kind of obvious.</p>
  
  <p>am I missing something that was hinted out in the quote?</p>
  
  <hr>
  
  <h2>UPDATE</h2>
  
  <p>edited typo of calling <code>a.foo()</code> (instead of <code>a.bar()</code>)and <code>b.foo()</code> (instead of <code>b.bar()</code>) in the original code </p>