updating local()

jepler at unpythonic.net jepler at unpythonic.net
Wed Oct 5 20:05:18 CEST 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.pgp>


More information about the Python-list mailing list