Created
January 14, 2014 14:01
-
-
Save jdswinbank/8418719 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
class MyClass(object): | |
def method1(self): | |
print "super m1" | |
def method2(self): | |
print "super m2" | |
def method3(self): | |
print "super m3" | |
self.method1() | |
self.method2() | |
class MySub(MyClass): | |
def method1(self): | |
print "sub m1" | |
def method4(self): | |
print "sub m4" | |
self.method1() | |
self.method2() | |
def method5(self): | |
print "sub m5" | |
super(MySub, self).method1() | |
super(MySub, self).method2() | |
if __name__ == "__main__": | |
MySub().method3() | |
print "---" | |
MySub().method4() | |
print "---" | |
MySub().method5() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment