Deprecating reload() ???

Greg Ewing (using wmwd2zz02 at
Mon Mar 15 02:19:58 CET 2004

Skip Montanaro wrote:
> Not so.  del sys.modules['mod']/import mod is effectively what reload()
> does.

Not quite -- reload() keeps the existing module object and changes
its contents, whereas the above sequence creates a new module

The difference will be apparent if any other modules have done
'import mod' before the reload.

Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand

More information about the Python-list mailing list