[Python-3000] Is reload() feasible?

Ian Bicking ianb at colorstudy.com
Fri Apr 14 18:01:01 CEST 2006


Benji York wrote:
> Ian Bicking wrote:
> 
>> Notably, Zope 3 does not include reloading (though it was included in 
>> Zope 2, in a more general form than just what reload() does).  It was 
>> removed because of these corner cases where it doesn't work, and 
>> because when these corner cases happen the results are inscrutable and 
>> frustrating errors.
> 
> 
> A bit more info: Gintautas Miliauskas has done a "view reloader" for Z3 
> (http://gintas.pov.lt/darcs/z3reload/README.txt) that only reloads a 
> very specific (but most often wanted) type of module.  We've considered 
> taking a similar approach and defining a very narrow set of requirements 
> to make a module reloadable.  Perhaps something along those lines would 
> be useful for Py3K.

Yes; having gone the restart direction, for some class of files a reload 
is also nice.  E.g., in another web framework it might be the controller 
files, presuming those files only contain controllers, and the system 
that accesses those files is smart about reloads -- and these are files 
that are being incrementally edited.  So a way of detecting "this module 
is really reloadable" is nice.  On the other end, sometimes there's 
non-Python files that need to trigger a full restart, like a 
configuration change (assuming you haven't built config reloading into 
your app).

-- 
Ian Bicking  /  ianb at colorstudy.com  /  http://blog.ianbicking.org


More information about the Python-3000 mailing list