Is there a debugger that allows you to modify Python code during debugging?
In other words: an exception is thrown at runtime, the debugger stops, I change the code in any way I like, and tell the program to continue.
I know the problems with this approach, so function references will still point to old definitions if I redefine the function on the fly, etc. I am fine with this since I just want to make small corrections in very simple circumstances.
On the other hand, I am also interested in whether it is theoretically possible to allow changes to Python code without using these problems: i.e. somehow update all links to changed objects, etc. I am almost sure the answer to the second question is no, but if I am mistaken, I would like to know.
EDIT: if my goal is (changing the code interactively when an exception occurs and then executing it), it is possible without a debugger - this is also good. I do not need to use a debugger.
source
share