Skip to content

Instantly share code, notes, and snippets.

@Lothiraldan
Created June 4, 2012 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lothiraldan/2867535 to your computer and use it in GitHub Desktop.
Save Lothiraldan/2867535 to your computer and use it in GitHub Desktop.
Super property/attribute access
class A(object):
class_attribute = 1
def __init__(self):
self.instance_attribute = 2
class B(A):
def test1(self):
print super(B, self).class_attribute
def test2(self):
print super(B, self).instance_attribute
b = B()
b.test1()
b.test2()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment