Let\'s say I have this :
def a(dict):
locals().update(dict)
print size
def b():
size = 20
f(locals())
What do I have to do to acc
print size
cannot work, because "size" is not known when the code is compiled. Your code will work if you change it like this:
def a(dict):
locals().update(dict)
print locals()["size"]
def b():
size = 20
a(locals())
But as the comment to your question already suggests: This is very strange code. I'm very sure that there are better solutions, if you explain what you really want to do.