Deprecating reload() ???

user at domain.invalid user at domain.invalid
Fri Mar 12 06:27:36 CET 2004


Ellinghaus, Lance wrote:

> 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'?

Ah, interesting! I've been doing this:

del modulename; import modulename

but it doesn't pick up any recent changes to the 
modulename.py file.

That's a better solution than exiting Python and 
starting it up again. Thanks!



-- 
Steven D'Aprano






More information about the Python-list mailing list