Skip to content

Instantly share code, notes, and snippets.

@moacirmoda

moacirmoda/mixin_sample.py

Last active Dec 17, 2018
Embed
What would you like to do?
class Foo:
def bar(self):
print(1)
class Mixin:
def bar(self):
print(2)
class New(Foo, Mixin):
pass
a = New()
a.bar() # 1
class NewNew(Mixin, Foo):
pass
a = NewNew()
a.bar() # 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.