[Idle-dev] IDLE interpreter window

Guido van Rossum guido@python.org
Tue, 07 Mar 2000 10:35:17 -0500


> David Scherer:
> >This is an artefact of the way Idle runs programs in its own interpreter.
> >Once a module is imported, it stays imported until you explicitly reload
> it, even across multiple runs.
> >
> >Moving to a model where the user program executes in a separate process
> >addresses this and many other problems.

Dirk Heise:
> Do you mean that every time the user fixes an error in one of the modules,
> he would have to reload the whole project? This would increase
> the turn around time.

Yes, but the required analysis to avoid this is quite tricky.  The
plans to run everything in a separate process will require a full
reload anyway.

> IMHO, one should find a way to exploit the dynamism
> of Python by just reloading the changed functions into the right namespaces.
> (Maybe this could be an option for advanced users, but it can save a lot
> of time in larger projects. It's possible via setattr.)

*Really* advanced users can already do this, using reload().  I think
it shouldn't be too hard to have a command "reload this class" or
"recompile this function".  In Python 1.6, I want to make the
func_code attribute of function objects writable.

> Would this be possible with a separate process for the user program?

Shouldn't make much of a difference, assuming we have a remote proces
control interface (which we need anyway for the remote debugger).

> Admittedly, sometimes you lose control, so an explicit reset (forcing a
> full reload) would be a needed function.

Yes, this is much safer in the light of typical unpredictable newbie
behavior.

--Guido van Rossum (home page: http://www.python.org/~guido/)