title: dynamic class inheritance using super
body: <p>I'm trying to dynamically create a class using <code>type()</code> and assign an <code>__init__</code> constructor which calls <code>super().__init__(...)</code>; however, when <code>super()</code> gets called I receive the following error:</p>
  
  <pre><code>TypeError: super(type, obj): obj must be an instance or subtype of type
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>class Item():    
      def __init__(self, name, description, cost, **kwargs):
          self.name           = name
          self.description    = description
          self.cost           = cost
          self.kwargs         = kwargs
  
  class ItemBase(Item):
      def __init__(self, name, description, cost):
          super().__init__(name, description, cost)
  
  def __constructor__(self, n, d, c):
      super().__init__(name=n, description=d, cost=c)
  
  item = type('Item1', (ItemBase,), {'__init__':__constructor__})
  item_instance = item('MyName', 'MyDescription', 'MyCost')
  </code></pre>
  
  <p>Why is <code>super()</code> inside the <code>__constructor__</code> method not understanding the object parameter; and how do I fix it?</p>