Skip to content

Instantly share code, notes, and snippets.

@tkf
Created September 4, 2009 14:41
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 tkf/180923 to your computer and use it in GitHub Desktop.
Save tkf/180923 to your computer and use it in GitHub Desktop.
class Super:
secret = {}
class Say1(Super):
def __init__(self):
self.secret[0] = 'this is my secret'
print "Say1:", self.secret
class Say2(Super):
def __init__(self):
self.secret[1] = 'no it isnt'
print "Say2:", self.secret
class Say3(Super):
def __init__(self):
self.secret[2] = 'help me'
print "Say3:", self.secret
s1 = Say1()
s2 = Say2()
s3 = Say3()
result = """
Say1: {0: 'this is my secret'}
Say2: {0: 'this is my secret', 1: 'no it isnt'}
Say3: {0: 'this is my secret', 1: 'no it isnt', 2: 'help me'}
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment