locals() and globals()

Fredrik Lundh fredrik at pythonware.com
Sat Oct 14 10:59:40 EDT 2006


Paolo Pantaleo wrote:

> why accessing the names dictionary globals() and locals() gives
> different results?

the documentation has the answer:

   "The contents of this dictionary should not be modified;
   changes may not affect the values of local variables used
   by the interpreter"

   http://pyref.infogami.com/locals

</F>




More information about the Python-list mailing list