reimport is a Python module designed to be a full featured replacement for Python's reload function. It is targeted towards making a reload that works for Python plugins and extensions used by longer running applications.
Reimport currently supports Python 2.4 through 2.6.
By its very nature, this is not a completely solvable problem. The goal of this module is to make the most common sorts of updates work well. It also allows individual modules and package to assist in the process. A more detailed description of what happens is on the overview page.
There are two functions in the API.
"""Reimport python modules. Multiple modules can be passed either by
name or by reference. Only pure python modules can be reimported."""
"""Find loaded modules that have changed on disk under the given path.
If no path is given then all modules are searched."""
There have been previous attempts at python reimporting. Most are incomplete or frightening, but several of them are worth a closer look.
* Livecoding is one of the more complete, it offers a special case directory tree of Python modules that are treated as live files.
* mod_python has implemented a similar reloading mechanism. The module reloading itself may be difficult to use outside mod_python's environment.
What's New in This Release: [ read full changelog ]
· Bugfix release.