Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Parent1:
- def __init__(self):
- print("Parent1.__init__")
- super().__init__()
- class Parent2:
- def __init__(self):
- print("Parent2.__init__")
- super().__init__()
- class Child(Parent1, Parent2):
- def __init__(self):
- print("Child.__init__")
- super().__init__()
- if __name__ == '__main__':
- print(Child.__mro__)
- Child()
- # Output:
- # (<class '__main__.Child'>, <class '__main__.Parent1'>, <class '__main__.Parent2'>, <class 'object'>)
- # Child.__init__
- # Parent1.__init__
- # Parent2.__init__
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement