This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gvanrossum
Recipients Mark.Shannon, arigo, belopolsky, benjamin.peterson, gvanrossum, ncoghlan, njs, vstinner, xdegaye, xgdomingo, yselivanov
Date 2017-10-13.16:31:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Hm.... I may just be completely off here, but I thought that compilers could be allowed to recognize the use of locals() in a particular function and then disable JIT optimizations for that function. (In fact I thought we already had a rule like this but I can't find any language about it, but maybe I'm mistaken and we only have such an exception for sys._getframe() -- though it's not mentioned in the docs for that either.)

I do like Nathaniel's idea of making locals() a write-through proxy (and let f_locals the same thing). If this keeps the frame alive, well too bad -- there are lots of other things that do this too, e.g. tracebacks.

Or what about a read-only proxy or a plain snapshot? The docs already say that it *shouldn't* be written and *may* not write through -- are we concerned that a lot of people depend on the actual runtime behavior rather than the documented behavior?
Date User Action Args
2017-10-13 16:31:24gvanrossumsetrecipients: + gvanrossum, arigo, ncoghlan, belopolsky, vstinner, benjamin.peterson, njs, xdegaye, Mark.Shannon, yselivanov, xgdomingo
2017-10-13 16:31:24gvanrossumsetmessageid: <>
2017-10-13 16:31:24gvanrossumlinkissue30744 messages
2017-10-13 16:31:24gvanrossumcreate