Created
February 12, 2021 04:21
-
-
Save cleder/d2b3b16cedde023afcc7747080e96f9a to your computer and use it in GitHub Desktop.
inheritance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo: | |
def __init__(self): | |
print('Foo') | |
class Bar: | |
def __init__(self): | |
print('bar') | |
class Test(Foo, Bar): | |
pass | |
t = Test() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The super() method will be called from left to right, the first super class that provides the method wins.
Other languages may call super methods of all super classes, or overwrite on construction so that the last class that provides the method wins.