Created
January 14, 2011 19:13
-
-
Save jirwin/780066 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
test = {} | |
class Cheese(object): | |
id = 0 | |
def __init__(self, id): | |
self.id = id | |
class Justin(object): | |
cheese = None | |
def __init__(self, id): | |
self.cheese = Cheese(id) | |
j = Justin(5) | |
t = getattr(j, "cheese.id") | |
print t |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment