title: Python extending with - using super() Python 3 vs Python 2
body: <p>Originally I wanted to ask <a href="https://stackoverflow.com/questions/4058400/using-colons-in-configparser-python">this question</a>, but then I found it was already thought of before...</p>
  <p>Googling around I found this example of <a href="http://sureshamrita.wordpress.com/2011/08/28/extending-python-configparser/ozn@yenikaro:%7E/Software/" rel="noreferrer">extending configparser</a>. The following works with Python 3:</p>
  <pre><code>$ python3
  Python 3.2.3rc2 (default, Mar 21 2012, 06:59:51) 
  [GCC 4.6.3] on linux2
  &gt;&gt;&gt; from configparser import  SafeConfigParser
  &gt;&gt;&gt; class AmritaConfigParser(SafeConfigParser):
  ...     def __init__(self):
  ...         super().__init__()
  ... 
  &gt;&gt;&gt; cfg = AmritaConfigParser()
  </code></pre>
  <p>But not with Python 2:</p>
  <pre><code>&gt;&gt;&gt; class AmritaConfigParser(SafeConfigParser):
  ...       def __init__(self):
  ...           super(SafeConfigParser).init()
  ... 
  &gt;&gt;&gt; cfg = AmritaConfigParser()
  Traceback (most recent call last):
    File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
    File &quot;&lt;stdin&gt;&quot;, line 3, in __init__
  TypeError: must be type, not classob
  </code></pre>
  <p>Then I read a little bit on Python New Class vs. Old Class styles (e.g. <a href="https://stackoverflow.com/questions/1713038/super-fails-with-error-typeerror-argument-1-must-be-type-not-classobj">here</a>.
  And now I am wondering, I can do:</p>
  <pre><code>class MyConfigParser(ConfigParser.ConfigParser):
        def Write(self, fp):
            &quot;&quot;&quot;override the module's original write funcition&quot;&quot;&quot;
            ....
        def MyWrite(self, fp):
            &quot;&quot;&quot;Define new function and inherit all others&quot;&quot;&quot;
  </code></pre>
  <p>But, shouldn't I call init? Is this in Python 2 the equivalent:</p>
  <pre><code> class AmritaConfigParser(ConfigParser.SafeConfigParser):
      #def __init__(self):
      #    super().__init__() # Python3 syntax, or rather, new style class syntax ...
      #
      # is this the equivalent of the above ? 
      def __init__(self):
          ConfigParser.SafeConfigParser.__init__(self)
  </code></pre>