Reloading modules

Jeff Davis jdavis at empires.org
Wed Feb 20 23:39:28 EST 2002


Is there a way to say that all calls to import should check for a newer 
version, if a newer one exists then completely drop the old one and import 
the new one?

I am aware of the reload() function, but it has enough caveats that it 
always leaves lingering questions. I usually end up just stopping and 
restarting the interpreter, which slows development/debugging. I would 
just like to be sure that any time after I import a module, I am using the 
newest version available at the time of import. I am also unsure as to 
whether modules imported within a reloaded module are also reloaded.

Thanks,
        Jeff



More information about the Python-list mailing list