[Python-Dev] reload() et al. (Re: [Import-sig] Re: Proposal for a modified import mechanism.) (original) (raw)

M.-A. Lemburg mal@lemburg.com
Thu, 15 Nov 2001 18:37:42 +0100


Thomas Heller wrote:

From: "Just van Rossum" <just@letterror.com> > M.-A. Lemburg wrote: > > > While it seems like a nice idea to update code which is already in > > use, I think that this leads down the wrong track. Sooner or > > later you'll end up with a complete mess in memory ;-) And depending > > on what code you exchange, this can cause serious problems: e.g. > > pickled data could become unusable, parts of the system would > > suddenly stop working because of e.g. a name change in one of the APIs, > > etc. > > I don't see "enhanced reloading" as a way to modify long running processes, but > a way to shorten the development cycle. That's exactly what I had in mind. More and more I hear complaints from people, that even a C++ program can be changed while running in the debugger (under certain circumstances), so why not Python?

The same is possible in Python's pdb, BTW. Anyway, my reply was more targetted in the direction of: "ok, this is nice to have as a hack during development, but doesn't solve any longstanding problems like e.g. unloading of modules". It's still a cool module -- perhaps you could also make it work for complete packages ?!

-- Marc-Andre Lemburg CEO eGenix.com Software GmbH


Consulting & Company: http://www.egenix.com/ Python Software: http://www.lemburg.com/python/