Message304345
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:24 | gvanrossum | set | recipients:
+ gvanrossum, arigo, ncoghlan, belopolsky, vstinner, benjamin.peterson, njs, xdegaye, Mark.Shannon, yselivanov, xgdomingo |
2017-10-13 16:31:24 | gvanrossum | set | messageid: <1507912284.88.0.213398074469.issue30744@psf.upfronthosting.co.za> |
2017-10-13 16:31:24 | gvanrossum | link | issue30744 messages |
2017-10-13 16:31:24 | gvanrossum | create | |
|