
class A:
  def __init__(self):
    self.iv = 'a'
  def mymethod(self):
    print('A wins')
    
    
class B:
  def __init__(self):
    self.iv = 'b'
  def mymethod(self):
    print('B wins')
    
    
class AB(A,B):
  # A's attribute gets chosen if A and B have an attribute of the same name.
  pass

class BA(B,A):
  # B's attribute gets chosen if A and B have an attribute of the same name.
  pass

if __name__ == '__main__':
  x = AB()
  print(x.iv)
  x.mymethod()
  
  y = BA()
  print(y.iv)
  y.mymethod()