updating local()
jepler at unpythonic.net
jepler at unpythonic.net
Wed Oct 5 14:05:18 EDT 2005
I'm surprised you found any example of 'locals().update' that worked.
Here's one that doesn't work:
def f(y):
locals().update({'x': y})
return x
print f(3) # prints 3?
Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20051005/825654d8/attachment.sig>
More information about the Python-list
mailing list