exec & function locals

Vadim Chugunov chega_ at yahoo.com
Fri Aug 13 07:24:21 CEST 1999


A question for those who are familiar with the Python's source code.

As well known,
    exec f.func_code in dictGlobals,dictLocals
will not update dictLocals because of the local binding optimizations
(LOAD_FASTs and STORE_FASTs)

However, I figure, this could be easily fixed by adding
    if (locals)
        PyFrame_FastToLocals(f);
at the end of eval_code2, just before the current frame is released.

Well, is there any particular reason, that I'm missing, for not having such code
in eval_code2 ?
Anyone ?

Vadim







More information about the Python-list mailing list