Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. In [9]: class A(object): [3/52]
  2. ...: def __init__(self, x):
  3. ...: print("A")
  4. ...: super().__init__()
  5. ...:
  6.  
  7. In [10]: class B(object):
  8. ...: def __init__(self, x):
  9. ...: print("B")
  10. ...: super().__init__()
  11. ...:
  12.  
  13. In [11]: class C(A, B):
  14. ...: def __init__(self, x):
  15. ...: print("C")
  16. ...: super().__init__(x)
  17. ...:
  18.  
  19. In [13]: C("x")
  20. C
  21. A
  22. ---------------------------------------------------------------------------
  23. TypeError Traceback (most recent call last)
  24. <ipython-input-13-001bd463ab56> in <module>()
  25. ----> 1 C("x")
  26.  
  27. <ipython-input-11-632bc831e6be> in __init__(self, x)
  28. 2 def __init__(self, x):
  29. 3 print("C")
  30. ----> 4 super().__init__(x)
  31. 5
  32.  
  33. <ipython-input-9-51f4d8e73a3b> in __init__(self, x)
  34. 2 def __init__(self, x):
  35. 3 print("A")
  36. ----> 4 super().__init__()
  37. 5
  38.  
  39. <ipython-input-9-51f4d8e73a3b> in __init__(self, x)
  40. 2 def __init__(self, x):
  41. 3 print("A")
  42. ----> 4 super().__init__()
  43. 5
  44.  
  45. TypeError: __init__() missing 1 required positional argument: 'x'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement