Created
September 4, 2009 14:41
-
-
Save tkf/180923 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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