title: Using super with a class method
body: <p>I'm trying to learn the super() function in Python.</p>
  
  <p>I thought I had a grasp of it until I came over this example (2.6) and found myself stuck.</p>
  
  <p><a href="https://web.archive.org/web/20170820065901/http://www.cafepy.com/article/python_attributes_and_methods/python_attributes_and_methods.html#super-with-classmethod-example" rel="noreferrer">http://www.cafepy.com/article/python_attributes_and_methods/python_attributes_and_methods.html#super-with-classmethod-example</a></p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "test.py", line 9, in do_something
      do_something = classmethod(do_something)
  TypeError: unbound method do_something() must be called with B instance as first argument (got nothing instead)
  &gt;&gt;&gt;
  </code></pre>
  
  <p>It wasn't what I expected when I read this line right before the example:</p>
  
  <blockquote>If we're using a class method, we don't have an instance to call super with. Fortunately for us, super works even with a type as the second argument. --- The type can be passed directly to super as shown below. </blockquote>
  
  <p>Which is exactly what Python tells me is not possible by saying that do_something() should be called with an instance of B.</p>