trying to modify locals() dictionary

Albert Hopkins marduk at letterboxes.org
Mon Jan 12 20:18:59 CET 2009


On Mon, 2009-01-12 at 19:51 +0100, TP wrote:
> Hi everybody,
> 
> I try to modify locals() as an exercise.
> According to the context (function or __main__), it works differently (see
> below). Why? Thanks
> 
> Julien

Per the locals() documentation @
http://docs.python.org/library/functions.html

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







More information about the Python-list mailing list