title: How could a class inherit from another class?
body: <p>How could a class inherit from another class? I am trying to implement it by the following example: </p>
  
  <pre><code>class parents(object):
        def __init__(self,dim_x, dim_y, nameprefix, sequence_number):
            if not isinstance(dim_x, (int, float, long)):
               raise TypeError("Dimension in x must be a number")
            else:
               self.sizex=str(int(dim_x))
            if not isinstance(dim_y, (int, float, long)):
               raise TypeError("Dimension in y must be a number")
            else:
               self.sizey=str(int(dim_y))
            if not isinstance(nameprefix, string_types):
                raise TypeError("The name prefix must be a string")
            else:
                self.prefix=nameprefix
            if not isinstance(sequence_number, (int, float, long)):
               raise TypeError("The sequence number must be given as a number")
            else:
               self.sqNr=str(int(sequence_number))
  </code></pre>
  
  <p>I want that the class <code>child</code> inherits the <code>prefix</code> and the <code>sqNr</code> from the <code>parents</code> class</p>
  
  <pre><code>class child(parents):
        def __init__(self,image_path='/vol/'):
           self.IMG_PATH=image_path
           self.ref_image=self.prefix+'_R_'+self.sqNr
           logger.debug('Reference image: %s', self.ref_image)
  </code></pre>
  
  <p>And run it with the following lines, but I get an error message:</p>
  
  <pre><code>&gt;&gt;&gt; p=parents(300, 300, 'Test',0 )
  &gt;&gt;&gt; p.prefix
  'Test'
  &gt;&gt;&gt; c=child(p)
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "&lt;stdin&gt;", line 4, in __init__
  AttributeError: 'child' object has no attribute 'prefix'
  </code></pre>
  
  <p>I don't understand what is wrong about my implementation, any suggestion?</p>