Last active
May 23, 2016 17:01
-
-
Save stoffie/6626da6db5c2c9c8f674e41f4697772a to your computer and use it in GitHub Desktop.
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
# method resolution order | |
class A: | |
def foo(self): | |
print('A.foo') | |
class B(A): | |
def foo(self): | |
print('B.foo') | |
super().foo() | |
class C(A): | |
def foo(self): | |
print('C.foo') | |
super().foo() | |
class D(B, C): | |
pass | |
D().foo() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment