Skip to content

Instantly share code, notes, and snippets.

@jdswinbank
Created January 14, 2014 14:01
Show Gist options
  • Save jdswinbank/8418719 to your computer and use it in GitHub Desktop.
Save jdswinbank/8418719 to your computer and use it in GitHub Desktop.
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