[Python-Dev] locals() different behaviour when tracing?
anders at 0x63.nu
Thu Oct 8 15:43:44 CEST 2009
Is it intentional that locals() returns a copy/snapshot of the local
variables sometimes, and sometimes a reference? Like when enabling
tracing, such as in the code pasted below. The documentation ("Update
and return a dictionary containing the current scope's local
variables.") is pretty unclear.
l = locals()
i = "foo"
print "Is 'i' in stored locals()? ", ('i' in l)
print "Running normally"
print "Enabling tracing"
More information about the Python-Dev