Deprecating reload() ???

Michael Hudson mwh at
Fri Mar 12 14:39:07 CET 2004

"Ellinghaus, Lance" <lance.ellinghaus at> writes:

> > > Other surprises:  Deprecating reload()
> >Reload doesn't work the way most people think
> >it does: if you've got any references to the old module,
> >they stay around. They aren't replaced.
> >It was a good idea, but the implementation simply
> >doesn't do what the idea promises.

I missed these mails...

> I agree that it does not really work as most people think it does, but how
> would you perform the same task as reload() without the reload()? 
> Would this be done by "del sys.modules['modulename']" and then perform an
> 'import'?
> I use reload() for many purposes, knowing how it works/does not work.

To paraphrase Tim Peters, you can have reload() when I'm dead.  Just
because it doesn't and never has done what some people expect is no
argument at all for deprecating it.


  But maybe I've just programmed in enough different languages to
  assume that they are, in fact, different.
     -- Tony J Ibbs explains why Python isn't Java on comp.lang.python

More information about the Python-list mailing list