Two curious errors when function globals are manipulated

eryk sun eryksun at gmail.com
Tue Jul 5 12:01:47 EDT 2016


On Tue, Jul 5, 2016 at 3:37 PM, eryk sun <eryksun at gmail.com> wrote:
> In CPython 3.6, LOAD_GLOBAL does fall back on PyObject_GetItem

I did some digging to find when this changed in 3.3:

https://hg.python.org/cpython/diff/e3ab8aa0216c/Python/ceval.c

Notice in the last comment on issue 14385 that Martijn wanted to
updated the docs for exec() to say that globals no longer has to be a
dict, but that would be wrong since STORE_GLOBAL and DELETE_GLOBAL
weren't updated. I don't know why it falls back on the abstract
PyObject_GetItem for LOAD_GLOBAL considering the other opcodes weren't
updated as well. It's pointless.



More information about the Python-list mailing list