title: What is the use of super(ClassName,self)._init_()
body: <p>I have a class that looks like this:</p>
  
  <pre><code>#!/usr/bin/env python
  class Foo:
      def __init__(self, x):
          self.x = x
      def bar(self):
          self.bar1_out = self.x + 5
          self.bar2_out = self.x + 1
          return (self.bar1_out,self.bar2_out)
      def qux(self,myvalue = None):
          first, second = myvalue or self.bar()
          return first + 3, second + 6
  
  def main():
      """docstring for main"""
      f = Foo(5)
  
      mbr_out1, mbr_out2 = f.bar()
      print mbr_out1, "\t", mbr_out2
  
      mqx_out1, mqx_out2 = f.qux()
      print mqx_out1, "\t", mqx_out2
  
      qout1, qout2 = f.qux((1))
      print qout1, "\t", qout2
  
  if __name__ == '__main__':
      main()
  </code></pre>
  
  <p>I saw some implementation that suggest using <code>super</code></p>
  
  <pre><code>    def __init__(self, x):
          super(Foo,self).__init__()
          self.x = x
      def bar(self)
          #etc.
  </code></pre>
  
  <p>My questions are:</p>
  
  <ol>
  <li>What's the use of <code>super(Foo,self).__init__()</code></li>
  <li>How does it differ from <code>self.x=x</code></li>
  <li>How can I make my code top above produce the same result by using <code>super()</code></li>
  </ol>