[pypy-dev] [mdione at grulic.org.ar: modifying locals]
Armin Rigo
arigo at tunes.org
Fri Oct 16 08:32:36 CEST 2015
Hi Marcos,
On Thu, Oct 15, 2015 at 4:50 PM, Marcos Dione <mdione at grulic.org.ar> wrote:
>> so I'll keep investigating :-]
>
> maybe context managers add a stack frame/do something with them
> internally?
Sorry, you're right. Now it seems from looking at the CPython source
code that there is no way. This is getting quite off-topic for the
pypy-dev list, but maybe this CPython-only awful hack:
import ctypes
ctypes.pythonapi.PyFrame_LocalsToFast(ctypes.py_object(frame), 0)
A bientôt,
Armin.
More information about the pypy-dev
mailing list