[spambayes-dev] Using reload() with modules from zips (Was MoreCVSbranch/tags questions)

Kenny Pitt kennypitt at hotmail.com
Thu Dec 4 17:55:40 EST 2003


Mark Hammond wrote:
> I'm also not sure exactly *why* we are doing a reload - saving user
> options should not require us to reload the Options module, and I'm
> fairly sure no code exists that updates the .zip with a new Options
> file even if it did :) 

I agree.  The Python manual says of the reload() function:  "This is
useful if you have edited the module source file using an external
editor and want to try out the new version without leaving the Python
interpreter."  In the binary, we have no source to reload.  Even when
running from source, it doesn't seem useful to recompile Options.py.  It
isn't done for any of the other modules.

I assume the reload has the side-effect of rerunning any initialization
that occurs when the module is first loaded, but what good would that do
during a save?  We already have all the options that the user specified
or we wouldn't be able to save them, so why throw them all out and then
immediately reload them again?  As far as I can tell, neither Options.py
or OptionsClass.py does anything except read in the values, so it
doesn't seem like there should be any side-effects.

Maybe we should just comment out the reload and see what happens (he
said while opening his text editor).

-- 
Kenny Pitt




More information about the spambayes-dev mailing list