title: Python3 super() and generic class
body: <p>I believe a test case is worth a thousand words:</p>
  
  <pre><code>#!/usr/bin/env python3
  
  def generate_a(key):
      class A(object):
          def method(self):
              return {'key': key,}
      return A
  
  BaseForB = generate_a(1337)
  
  class B(BaseForB):
      def method(self):
          dict = super(BaseForB, self).method()
          dict.update({'other_key': 0,})
          return dict
  
  EXPECTED = {'other_key': 0, 'key': 1337,}
  RESULT = B().method()
  
  if EXPECTED == RESULT:
      print("Ok")
  else:
      print("EXPECTED: ", EXPECTED)
      print("RESULT: ", RESULT)
  </code></pre>
  
  <p>This raises:</p>
  
  <pre><code>AttributeError: 'super' object has no attribute 'method'
  </code></pre>
  
  <p>The question is - how to run <code>A.method()</code> in <code>B.method()</code> (the thing I tried to do with <code>super()</code>)</p>
  
  <p><strong>edit</strong></p>
  
  <p>Here's more appropriate test case:</p>
  
  <pre><code>#!/usr/bin/env python3
  
  def generate_a(key):
      class A(object):
          def method(self):
              return {'key': key,}
      return A
  
  class B(object):
      def method(self):
          return {'key': 'thisiswrong',}
  
  BaseForC = generate_a(1337)
  
  class C(B, BaseForC):
      def method(self):
          dict = super(C, self).method()
          dict.update({'other_key': 0,})
          return dict
  
  EXPECTED = {'other_key': 0, 'key': 1337,}
  RESULT = C().method()
  
  if EXPECTED == RESULT:
      print("Ok")
  else:
      print("EXPECTED: ", EXPECTED)
      print("RESULT: ", RESULT)
  </code></pre>
  
  <p>The question is - how do I choose which parent class I'm interested in?</p>