Skip to content

Instantly share code, notes, and snippets.

@cesarkawakami
Created December 31, 2012 20:24
Show Gist options
  • Save cesarkawakami/4422477 to your computer and use it in GitHub Desktop.
Save cesarkawakami/4422477 to your computer and use it in GitHub Desktop.
class F(object):
pass
place_data_items = {}
place_data_items["state"] = [F(), F(), F()]
for pt, items in place_data_items.iteritems():
if pt == 'state':
for i in items:
print "update loop: %s" % i
for item in place_data_items["state"]:
print "_children loop: %s" % item
# output
update loop: <__main__.F object at 0x10046d650>
update loop: <__main__.F object at 0x10046d890>
update loop: <__main__.F object at 0x10046d8d0>
_children loop: <__main__.F object at 0x10046d650>
_children loop: <__main__.F object at 0x10046d890>
_children loop: <__main__.F object at 0x10046d8d0>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment