explain this

Erno Kuusela erno-news at erno.iki.fi
Tue Jul 3 15:46:57 EDT 2001


In article <25b2e0d9.0107031136.5dc0dad2 at posting.google.com>,
alankarmisra at hotmail.com (gods1child) writes:

| In the code below, why can i add elements to locals but not delete them?

from <URL: http://www.python.org/doc/lib/built-in-funcs.html#l2h-187>:

locals() 
      Return a dictionary representing the current local symbol
      table. Warning: The contents of this dictionary should not be
      modified; changes may not affect the values of local variables
      used by the interpreter.

this is because python doesn't (always) actually use a dictionary
internally to store local variables, to speed up execution.

  -- erno




More information about the Python-list mailing list