[Python-Dev] Deprecating locals() (was Re: nested scopes and global: some corner cases)

Greg Ewing greg@cosc.canterbury.ac.nz
Mon, 12 Mar 2001 16:10:19 +1300 (NZDT)


Samuele Pedroni <pedroni@inf.ethz.ch>:

> I imagine a (new) function that produce a snap-shot of the values in
> the local,free and cell vars of a scope can do the job required for
> simple debugging (the copy will not allow to modify back the values)

Modifying the values doesn't cause any problem, only
adding new names to the scope. So locals() or whatever
replaces it could return a mapping object that doesn't 
allow adding any keys.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg@cosc.canterbury.ac.nz	   +--------------------------------------+