title: Create class from dynamically created list of bases
body: <p>Is there any way to create a class from a dynamic list of base classes?</p>
  
  <pre><code>def dynamic_class_creator(base, base2):
      class Derived(base, base2):
          pass
      return Derived
  
  class Mixin1(object):
      def greet(self):
          print ("Howdy!")
  
  class Mixin1a(object):
      def insult(self):
          print ("You have a lot to learn.")
  
  class Mixin2(object):
      def insult(self):
          print ("Idiot!")
  
  polite = dynamic_class_creator(Mixin1, Mixin1a)()
  polite.greet()
  polite.insult()
  
  complex = dynamic_class_creator(Mixin1, Mixin2)()
  complex.greet()
  complex.insult()
  </code></pre>
  
  <p>This works as expected:</p>
  
  <pre><code>Howdy!                    
  You have a lot to learn.  
  Howdy!                    
  Idiot!
  </code></pre>
  
  <p>But I can't figure out how to assign these bases from a list of arbitrary length:</p>
  
  <pre><code>def dynamic_class_creator(*bases):
      class Derived(*bases):
          pass
      return Derived
  (...)
  </code></pre>
  
  <p>gives:</p>
  
  <pre><code>  File "../test2.py", line 4
      class Derived(*bases):  
                    ^         
  SyntaxError: invalid syntax 
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>One suggested solution:</p>
  
  <pre><code>def dynamic_class_creator(*bases):
      class Derived(bases):
          pass
      return Derived
  (...)
  </code></pre>
  
  <p>Gives:</p>
  
  <pre><code>Traceback (most recent call last):
    File "../test2.py", line 20, in &lt;module&gt;
      polite = dynamic_class_creator(Mixin1, Mixin1a)()
    File "../test2.py", line 4, in dynamic_class_creator
      class Derived(bases):
  TypeError: Error when calling the metaclass bases
      tuple() takes at most 1 argument (3 given)
  </code></pre>