fork download
  1. class A():
  2. def __init__(self):
  3. self.a='a'
  4.  
  5. def foo_a(self):
  6. print('a')
  7.  
  8. class B():
  9. def __init__(self):
  10. self.b='b'
  11. self.b1='b'
  12.  
  13. def foo_b(self):
  14. print('b')
  15.  
  16.  
  17. d = A().__dict__
  18. d.update(B().__dict__)
  19. C = type('C', (A,B), d)
  20. print(dir(C()))
  21.  
Success #stdin #stdout 0.02s 9984KB
stdin
Standard input is empty
stdout
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'a', 'b', 'b1', 'foo_a', 'foo_b']