title: Abstract method and mixin in python
body: <p>I'd like to submit a code pattern I often see in my python code, here at work, and I'm not satisfy with it and I'd like a better solution.</p>
  
  <p>Here is what we have today:</p>
  
  <pre><code>class AbstractClass(object):
      ....
      def method1(self,...)
         raise NotImplementedError
      ...
  
  class FirstImplementationMixin(object)
      def method1(self,....) 
         ...
  
  class SecondImplementationMixin(object)
      def method1(self...)
         ....
  
  class InstanciatedClass1(FirstImplementationMixin, AbstractClass)
      ....
  
  class InstanciatedClass2(SecondImplementationMixin, AbstractClass)
      ....
  </code></pre>
  
  <p>Do you see the trick? I have to add the mixin at first position in the list
  of the inheritance, and I don't like this solution. If we add it at the second position, the interpreter will use AbstractClass.method1 and so raise the exception.</p>
  
  <p>In this trivial situation, replacing the mixin by intermediate class is possible, but in case of complex inheritance with already a base class, the solution might not be obvious.</p>
  
  <p>What is for you the best design pattern?</p>