Last active
August 29, 2015 14:25
-
-
Save rafaelhenrique/711437120ef10a272206 to your computer and use it in GitHub Desktop.
See method resolution order effects
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 ClassA(object): | |
print("Class A") | |
def __init__(self): | |
print("Instance of A") | |
def test(self): | |
print("Test of A") | |
class ClassB(object): | |
print("Class B") | |
def __init__(self): | |
print("Instance of B") | |
def test(self): | |
print("Test of B") | |
class ClassC(object): | |
print("Class C") | |
def __init__(self): | |
print("Instance of C") | |
def test(self): | |
print("Test of C") | |
class BigSalad(ClassA, ClassB, ClassC): | |
def test(self, *args, **kwargs): | |
super(BigSalad, self).test(*args, **kwargs) | |
if __name__ == "__main__": | |
s = BigSalad() | |
s.test() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment