Nick Coghlan <ncogh...@gmail.com> added the comment:

Just confirming that the locals() vs frame.f_locals distinction also exists in 
the C API: the former is PyEval_GetLocals() (which implicitly ensures the 
snapshot is up to date), while the equivalent of the latter is direct access to 
frame->f_locals (and it's left to code accessing the field to decide whether it 
needs an up to date snapshot or not).

That means I'll be able to change what we store in frame->f_locals, while 
updating PyEval_GetLocals to check for a _FastLocalsProxy instance and return a 
reference to the underlying snapshot instead.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue30744>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to