Skip to content

Instantly share code, notes, and snippets.

@stoffie
Last active May 23, 2016 17:01
Show Gist options
  • Save stoffie/6626da6db5c2c9c8f674e41f4697772a to your computer and use it in GitHub Desktop.
Save stoffie/6626da6db5c2c9c8f674e41f4697772a to your computer and use it in GitHub Desktop.
# 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