fork download
  1. class A(object):
  2. def __init__(self, a):
  3. self.a = a
  4.  
  5. def foo_a(self):
  6. print(self.a)
  7.  
  8. class B(object):
  9. def __init__(self, b):
  10. self.b = b
  11.  
  12. def foo_b(self):
  13. print(self.b)
  14.  
  15. class C(A,B):
  16. def __init__(self, a, b):
  17. A.__init__(self, a)
  18. B.__init__(self, b)
  19.  
  20. c = C(a='AAA', b='BBB')
  21.  
  22. #print(dir(c))
  23. c.foo_a()
  24. c.foo_b()
Success #stdin #stdout 0.02s 9944KB
stdin
Standard input is empty
stdout
AAA
BBB