title: Are Mixin class __init__ functions not automatically called?
body: <p>I'd like to use a Mixin to always add some init functionality to my child classes which each inherit from different API base classes. Specifically, I'd like to make multiple different child classes that inherit from one of these different API-supplied base classes and the one Mixin, which will always have the Mixin initialization code executed in the same way, without code replication.  However, it seems that the __init__ function of the Mixin class never gets called unless I explicitly call it in the Child class's __init__ function, which is less than ideal.  I've built up a simple test case:</p>
  
  <pre><code>class APIBaseClassOne(object):
      def __init__(self, *args, **kwargs):
          print (" base ")
  
  class SomeMixin(object):
      def __init__(self, *args, **kwargs):
          print (" mixin before ")
          super(SomeMixin, self).__init__(*args, **kwargs)
          print (" mixin after ")
  
  class MyClass(APIBaseClassOne):
      pass
  
  class MixedClass(MyClass, SomeMixin):
      pass
  </code></pre>
  
  <p>As you can see in the following output, the Mixin function's init never gets called:</p>
  
  <pre><code>&gt;&gt;&gt; import test
  &gt;&gt;&gt; test.MixedClass()
   base
  &lt;test.MixedClass object at 0x1004cc850&gt;
  </code></pre>
  
  <p>Is there a way to do this (have an init function in a Mixin get called) without writing every child class to explicitly invoke the Mixin's init function? (i.e., without having to do something like this in every class:)</p>
  
  <pre><code>class MixedClass(MyClass, SomeMixin):
      def __init__(*args, **kwargs):
          SomeMixin.__init__(self, *args, **kwargs)
          MyClass.__init__(self, *args, **kwargs) 
  </code></pre>
  
  <p>Btw, if all my child classes were inheriting from same base class, I realize I could create a new middle class that inherits from the base class and the mixin and keep it DRY that way. However, they inherit from different base classes with common functionality. (Django Field classes, to be precise).</p>