how to modify code while debugging it without having to stop and then restart debugger

Magnus Lycka lycka at carmen.se
Thu Nov 10 04:48:44 EST 2005


Mike Meyer wrote:
> In that case, you're using the wrong IDE. I run the Python interpeter
> inside of Emacs. I edit my code in another buffer. In the source code
> buffer, I hit M-C-x, and the current version of the function I'm
> currently editing gets sent to the interpreter. Reload is pretty easy
> as well - C-c RETURN, and the module I'm editing gets reloaded.

As far as I understand, the OP wanted to do this while single-stepping
through the program he's editing. While this might work as a kind of
exploration, it's probably not an optimal development strategy. It
might be difficult to predict how the program will run the next time
if you manipulate it during execution.

I think test-driven development as described e.g. in my EPC presentation
last year is more rewarding: http://www.thinkware.se/epc2004test/
(See e.g. the log.html)

I suppose different languages and tools foster different styles of
work, and I can understand that it's frustrating if a favoured style
of development isn't really supported by the Python tools--even though
few Python programmers bother about single-stepping through their
code.

In general, it's clearly non-optimal to run code many magnitudes
slower than the nominal speed, and I suspect that few people would
care to do that unless the structure of the code they work with
was messy.

I guess it's a bit like driving an old crappy car, and then getting
into a new Toyota. I can understand that it seems strange not to
have the trunk filled with tools if you're about to take a long trip,
but it's probably a mistake to think that this will make the journey
with the Toyota more problematic than the trip would have been with
a car that you need to repair every now and then.



More information about the Python-list mailing list