title: When to call a super-class' method?
body: <p>I'm working on extending a project maintained by a group of developers. My code involves overriding of methods in the classes from existing code. One of the points of discomfort to me is that I don't know how exactly to override super-class methods.</p>
  
  <p>Below is the description:</p>
  
  <pre><code>def foo(self):
      return self.something
  </code></pre>
  
  <p>When I extend this, should I generally try to:</p>
  
  <p><strong>(1)</strong></p>
  
  <pre><code>def foo(self):
      old_something = super(Sub, self).foo()
      # my code
      return old_something
  </code></pre>
  
  <p>or</p>
  
  <p><strong>(2)</strong></p>
  
  <pre><code>def foo(self):
      # my code
      return super(Sub, self).foo()
  </code></pre>
  
  <p>I'm sure there's no universal answer, but what is the default? For example, in CL, if you don't specify this behaviour, the default qualifier in method combination is <code>:around</code>, meaning case <strong>(2)</strong>. But, in Java, for example, the convention is to call super on the very first line of the method that overrides it, i.e. case <strong>(1)</strong>. What is the Python way to do it?</p>
  
  <p>EDIT:</p>
  
  <p>If I do:</p>
  
  <pre><code>$ find . -type f -name "*.py" | xargs grep '= super' | wc -l
  </code></pre>
  
  <p>on the project I work on, I get more hits, then if I do:</p>
  
  <pre><code>$ find . -type f -name "*.py" | xargs grep 'return super' | wc -l
  </code></pre>
  
  <p>Just out of curiosity. Does this hold for some of you / most of you? :)</p>