fork download
  1. class Parent1(object):
  2. def foo(self):
  3. print "P1 foo"
  4.  
  5. def bar(self):
  6. print "P1 bar"
  7.  
  8.  
  9. class Parent2(object):
  10. def foo(self):
  11. print "P2 foo"
  12.  
  13. def bar(self):
  14. print "P2 bar"
  15.  
  16.  
  17.  
  18. class Child(Parent1, Parent2):
  19. def foo(self):
  20. Parent1.foo(self)
  21.  
  22. def bar(self):
  23. Parent2.bar(self)
  24.  
  25. c = Child()
  26. c.foo()
  27. c.bar()
Success #stdin #stdout 0.01s 9016KB
stdin
Standard input is empty
stdout
P1 foo
P2 bar