title: python subclasses
body: <p>I currently have a class called Polynomial, The initialization looks like this:</p>
  
  <pre><code>def __init__(self, *termpairs):
      self.termdict = dict(termpairs) 
  </code></pre>
  
  <p>I'm creating a polynomial by making the keys the exponents and
  the associated values are the coefficients. To create an instance of this class, you enter as follows:</p>
  
  <pre><code>d1 = Polynomial((5,1), (3,-4), (2,10))
  </code></pre>
  
  <p>which makes a dictionary like so:</p>
  
  <pre><code>{2: 10, 3: -4, 5: 1}
  </code></pre>
  
  <p>Now, I want to create a subclass of the Polynomial class called Quadratic. I want to call the Polynomial class constructor in the Quadratic class constructor, however im not quite sure how to do that. What I have tried is:</p>
  
  <pre><code>class Quadratic(Polynomial):
  def __init__(self, quadratic, linear, constant):
      Polynomial.__init__(self, quadratic[2], linear[1], constant[0])
  </code></pre>
  
  <p>but I get errors, anyone have any tips? I feel like I'm using incorrect parameters when I call the Polynomial class constructor.  </p>