changing Python code in the debugger
- by max
Is there any debugger that allows Python code to be changed while debugging?
In other words: run-time exception occurs, debugger stops, I change the code any way I like, and tell the program to continue.
I am aware of the problems with this approach, such that references to functions would still point to the old definitions if I redefine the function on the fly, and so on. I am ok with that, since I just want to be able to make small fixes in very simple circumstances.
On the other hand, I'm also interested in whether it's theoretically possible to allow changes to Python code without running into these problems: i.e., somehow update all the references to the objects that changed, etc. I'm nearly sure the answer to the second question is no, but if I'm wrong, I'd like to know.
EDIT: If my goal (changing the code interactively when an exception occurred, and then continuing execution), is achievable without a debugger - that would be good as well. I don't need to use the debugger.