On 9/18/2012 5:51 PM, Thomas Jollans wrote:
On 09/18/2012 10:50 PM, weissman.m...@gmail.com wrote:
Well there's wired stuff like this:

In [1]: locals()["x"] = 5

In [2]: print x
5


No, there isn't. Modifying the dictionary returned by locals() has no
effect.

Last time I tried it, it does within a class -- in cpython at least. That locals dict usually becomes the __dict__ of the class. But not to be depended on indefinitely and across implmentations.


--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to