Skip to content

Instantly share code, notes, and snippets.

@pauricthelodger
Created December 17, 2015 11:57
Show Gist options
  • Save pauricthelodger/1172dbb901e72ae86c3d to your computer and use it in GitHub Desktop.
Save pauricthelodger/1172dbb901e72ae86c3d to your computer and use it in GitHub Desktop.
class SomeMixin(object):
def func(self):
print("In Mixin")
print(self)
print(self.__class__)
super(SomeMixin, self).func()
class SomeOtherBaseClass(object):
def func(self):
print("In SomeOtherBaseClass")
print(self)
print(self.__class__)
def other_func(self):
print("Got here")
class SomeBaseClass(object):
def func(self):
print("In BaseClass")
print(self)
print(self.__class__)
def other_func(self):
print("Got here too")
class SomeObject(SomeMixin, SomeBaseClass):
"""pass"""
class SomeOtherObject(SomeMixin, SomeOtherBaseClass):
"""pass"""
so = SomeObject()
so.func()
so.other_func()
soo = SomeOtherObject()
soo.func()
soo.other_func()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment