title: how to call parent class methods in python?
body: <p>I am writing a class in python.</p>
  
  <pre><code>class my_class(object):
      def __init__(self):
      # build my objects 
      def foo(self,*args,**kwargs):
      # do something with them
  </code></pre>
  
  <p>Then I would like to extend this class:</p>
  
  <pre><code>class my_extended_class(my_class):
  </code></pre>
  
  <p>But I can not figure out what is the correct way of accessing parent methods.</p>
  
  <p>Shall I:</p>
  
  <p>1) create an instance of a father object? at constructor time</p>
  
  <pre><code>def __init__(self):
      self.my_father=my_class()
      # other child-specific statements
      return self
  def foo(self,*args,**kwargs):
      self.my_father.foo(*args,**kwargs)
      # other child-specific statements
      return self
  </code></pre>
  
  <p>2)  call father methods 'directly'?</p>
  
  <pre><code>def foo(self,*args,**kwargs):
      my_class.foo(*args,**kwargs)
      # other child-specific statements
      return self
  </code></pre>
  
  <p>3) other possible ways?</p>