[Pythonmac-SIG] MacPython IDE doesn't reload edited files

Joseph J. Strout joe@strout.net
Sun, 7 Mar 1999 20:30:58 -0800


I find that the IDE will reload your module if you Run it again.  (It
doesn't matter whether you save it or not.)  This is obvious if you have a
single-module project, less obvious for more complex projects.  Suppose
your main program is in A.py, which calls stuff in B.py.  Simply editing
B.py and saving is not enough; running A.py will run the old B, since it
still has a reference to the old B data in its namespace.  You have to run
B (even if running B has no apparent effect, because it has no main
program), and then run A.

In very complex projects, where lots of modules have lots of references to
other modules, it can difficult to force all the different modules to
forget their references to old code.  I have one project like this, where
the easiest thing to do is to quit and restart the IDE.  I hate that too,
but I don't know what to do about it -- reloading modules has always been a
pain, even in traditional console-mode Python.

HTH,
-- Joe

,------------------------------------------------------------------.
|    Joseph J. Strout           Biocomputing -- The Salk Institute |
|    joe@strout.net             http://www.strout.net              |
`------------------------------------------------------------------'