Deprecating reload() ???

Paul Miller paul at
Fri Mar 12 20:21:41 CET 2004

> >> It's worse than just a surprise.  It's a serious problem when what you
> >> need to do is what most people are expecting -- replace every
> >> reference to objects in the old module with references to the new
> >> objects.  The problem becomes a near impossibility when those
> >> references are scattered throughout a multi-module program.


> > I don't consider this a problem with reload, I consider it a design
> > defect.  If there's a need for such a thing, it should be designed in to


>I agree, most programs should not have 'reload()' designed in, and
>those that do, should be well aware of its limitations.  I'm concerned

I've been working around the problem with reload by loading my modules into 
self-contained interpreters, using the multiple interpreter API. This all 
worked wonderfully until Python 2.3, where it all sort of broke.

I would be able to do to all with one interpreter, *if* reload did "what I 

Clearly, there needs to be SOME solution to this problem, as I'm definitely 
not the only person trying to do this.

(the context comes from wanting to use Python modules as "plugins" to a C++ 
application - and to aid in development, be able to reload plugins on the 
fly if there code is changed).

More information about the Python-list mailing list