title: Python - inheriting from old-style classes
body: <p>I am trying to connect via telnet to a laboratory instrument. I'd like to extend the <code>Telnet</code> class from the <code>telnetlib</code> module in the standard library, to include functions specific to our instrument:</p>
  
  <pre><code>import telnetlib
  class Instrument(telnetlib.Telnet):
      def __init__(self, host=None, port=0, timeout=5):
          super(Instrument,self).__init__(host, port, timeout)
  </code></pre>
  
  <p>All I am trying to do in this code is inherit the <code>__init__</code> method from the parent class (<code>telnetlib.Telnet</code>) and pass on the standard arguments, so I can add things to <code>__init__</code> later. This formula has worked for me on other occasions; this time it gives me an error at the <code>super()</code> statement when I try to instantiate:</p>
  
  <pre><code>TypeError: must be type, not classobj
  </code></pre>
  
  <p>I looked at the source code for telnetlib, and Telnet appears to be an old-style class (it doesn't inherit from <code>object</code>) - I'm wondering if this could be the source of my problem? If so, how can it be overcome? I've seen some code examples where the derived class inherits both from the superclass and <code>object</code>, though I'm not entirely sure if this is a response to the same problem as me.</p>
  
  <p>Full disclosure: I have also tried using <code>telnetlib.Telnet</code> in place of <code>super()</code>, and <code>from telnetlib import Telnet</code> with <code>Telnet</code> in place of <code>super()</code>. The problem persists in these cases.</p>
  
  <p>Thanks!</p>