[ZODB-Dev] Reloading product in 2.8
Shane Hathaway
shane at hathawaymix.org
Fri Jul 15 00:05:38 EDT 2005
Jim Fulton wrote:
> It also doesn't handle global data properly.
>
> It tries to do something that Python modules were never
> designed to support, which is to load them more than once.
However, given the existence of the reload() builtin, someone apparently
believed Python modules *were* designed to support reloading. Because
reload() is a builtin, Python seems to promise that reload() is
reliable, but in fact it's rarely reliable. There would be a lot less
confusion if reload() were moved somewhere like the "imp" module.
> When it fails, it does so in subtle ways that cause people
> to lose lots of time.
I agree. The right way to refresh is to detect code changes (ideally
using Linux's brand new inotify mechanism, or something similar when
inotify is not available), display a "please wait" message to the user,
and restart the process.
Shane
More information about the ZODB-Dev
mailing list