Skip to content

Instantly share code, notes, and snippets.

@jirwin
Created January 14, 2011 19:13
Show Gist options
  • Save jirwin/780066 to your computer and use it in GitHub Desktop.
Save jirwin/780066 to your computer and use it in GitHub Desktop.
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