Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In [9]: class A(object): [3/52]
- ...: def __init__(self, x):
- ...: print("A")
- ...: super().__init__()
- ...:
- In [10]: class B(object):
- ...: def __init__(self, x):
- ...: print("B")
- ...: super().__init__()
- ...:
- In [11]: class C(A, B):
- ...: def __init__(self, x):
- ...: print("C")
- ...: super().__init__(x)
- ...:
- In [13]: C("x")
- C
- A
- ---------------------------------------------------------------------------
- TypeError Traceback (most recent call last)
- <ipython-input-13-001bd463ab56> in <module>()
- ----> 1 C("x")
- <ipython-input-11-632bc831e6be> in __init__(self, x)
- 2 def __init__(self, x):
- 3 print("C")
- ----> 4 super().__init__(x)
- 5
- <ipython-input-9-51f4d8e73a3b> in __init__(self, x)
- 2 def __init__(self, x):
- 3 print("A")
- ----> 4 super().__init__()
- 5
- <ipython-input-9-51f4d8e73a3b> in __init__(self, x)
- 2 def __init__(self, x):
- 3 print("A")
- ----> 4 super().__init__()
- 5
- TypeError: __init__() missing 1 required positional argument: 'x'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement