I have a class extending bdb.Bbd that I use for analyzing Python 3 code. Now, I need to also modify some of the variable values as it steps through the program.
Outside of functions, I can do this by just modifying the frame.f_locals dictionary:
frame.f_locals['x'] = 2
I can't figure out how to do this inside functions without using the ctypes trick mentioned in this question. I'm running Python 3 inside Pyodide which unfortunately does not support ctypes yet.
 
     
    