title: Python: Programatically create subclasses based on __init__ values
body: <p>I have a base class from which I would like to make many subclasses. The subclasses differ only in the arguments used to call the base class during instantiation. The example below shows how to make a subclass <code>Apple</code>. Is there a way to do this programatically, without having to code the subclass' <code>__init__</code> method? This seems like a job for metaclasses, but in this case I cannot modify the base class.</p>
  
  <pre><code>apple = {'color': 'red', 'shape': 'sphere'}
  pear = {'color': 'yellow', 'shape': 'cone'}
  melon = {'color': 'green', 'shape': 'prolate'}
  
  class Fruit(object):
      def __init__(self, color, shape):
          self.color = color
          self.shape = shape        
  
  class Apple(Fruit):
      def __init__(self):
          Fruit.__init__(self, **apple)
  </code></pre>