[issue44028] Request for locals().update() to work, it is

Terry J. Reedy report at bugs.python.org
Sat May 8 01:45:54 EDT 2021


Terry J. Reedy <tjreedy at udel.edu> added the comment:

When quoting, please include the source, preferably a direct link.

In Python 1 and 2, there were two function local namespace *implementations* -- array index by number or dictionary indexed by name.  The implementation, and hence the lookup mode, was fixed at compile time.  In Python 3, the one *implementation*, and its lookup mode, are fixed.  The slower implementation was dropped because it was not thought worth the bother.  

When you invoke the save function while playing a game, I am imagine that the save function does not have access to and does not same the locals of whatever function was executing at the time you hit the save key.  Rather a game and player states are serialized, and likely not in one line of code.

----------
nosy: +terry.reedy

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44028>
_______________________________________


More information about the Python-bugs-list mailing list