Reloading modules

Thomas Heller theller at python.net
Thu Feb 21 06:53:10 EST 2002


"Jeff Davis" <jdavis at empires.org> wrote in message news:a51tt1$msq$1 at news1.ucsd.edu...
> 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.
>
I once posted a module which does this:

http://mail.python.org/pipermail/python-list/2001-November/072669.html

HTH,

Thomas





More information about the Python-list mailing list