How about being able to modify and restart code in a debugger thread?
Part of this entails allowing restartable / resumable exceptions.
Most Smalltalks support this, and it greatly increases productivity in
For example, consider when you run a Jython-based simulation for an hour
only to get an exception from a trivial typo which such a debugging system
would allow you to easily correct and restart from. Instead, you need to
restart the code and wait another hour for the next typo. Yes, you can try
to write your code to work around this sort of problem with checkpoints
and events and such, but should not this be made easier, especially for
beginners? A less extreme situation is when you are processing, say, an
XML file, which takes a few minutes, and you need to keep restarting with
each change. Anyway, not being able to restart easily decreases Python
There is also a style of "coding in the debugger" where you write stubs
for functions and just flesh them out while running the program.
To look at this more generally, essentially you are adding the capability
to Python / Jython to "edit and continue" -- which might include writing a
PEP, likely modifying Jython (and maybe Python), and modifying a GUI to
use the changes (e.g. PyDev might be a good choice).
Smalltalk (including Squeak) has had this since the 1970s, but even Visual
Basic can do it these days:
From there: "Edit and Continue is a time-saving feature that enables you
to make changes to your source code while your program is in break mode.
When you resume execution of the program by choosing an execution command
like Continue or Step, Edit and Continue automatically applies the code
changes with some limitations. This allows you to make changes to your
code during a debugging session, instead of having to stop, recompile your
entire program, and restart the debugging session."
It's a shame Python and Jython can't do what even Microsoft products can.
And no, module reloading (even using xreload.py or the code I previously
posted on it) is not general enough to be able to modify a running thread
and resume with all the old variable values with the new code. Xreload or
the code I posted is general enough to modify code in a running GUI
application, but only only for future GUI events (not one currently having
You can see related recent comments on this in the Python Edusig list,
Guido said it was "impossible",
so it would make a nice challenge for someone (perhaps even moving Jython
ahead of Python in some ways. :-) No guarantee of success, but a worth
effort which would certainly require someone to learn the core of Jython
and how it does exception handling. For inspiration, see:
"What's that you say? Impossible, is it? We'll just see about that."
A.M. Kuchling wrote:
> Google's Summer of Code is coming around again, and the PSF would like
> to focus more on core things. Are there Jython-related project ideas
> that would make good summer projects?
> A few (a *very* few) ideas are listed at
> <http://wiki.python.org/moin/JythonProjects>, but they don't seem to
> have been proposed by the Jython developers. I couldn't find any
> project-idea pages in the Jython wiki; is there one?