trouble with reload

Colin J. Williams cjw at
Fri Aug 14 15:23:17 CEST 2009

Terry Reedy wrote:
> Dr. Phillip M. Feldman wrote:
>> According to the Python documentation, 'reload' reloads a previously 
>> imported
>> module (so that changes made via an external editor will be 
>> effective). But, when I try to use this command, I get the following 
>> error message:
>> TypeError: reload() argument must be module
>> Any suggestions will be appreciated.
> Besides the other answers, do not use reload. It is removed in Py3 
> because it cannot be made to work as people reasonably expect.
> tjr
It's typically a user module that needs to be reloaded.

It seems that  del sys.modules['moduleName'] has no effect.

Is there some other way of ensuring that any import goes to, 
instead of moduleName.pyc?

Colin W.

More information about the Python-list mailing list