Reloading a module
Jeff Epler
jepler at unpythonic.net
Tue Oct 1 07:39:15 EDT 2002
More information about the Python-list mailing list
Tue Oct 1 07:39:15 EDT 2002
- Previous message (by thread): XML, Unicode
- Next message (by thread): Reloading a module
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
So you're not worried that names defined in the new version of the module
aren't being created, but that names defined in the old version (but not
the new one) will persist?
Then why not define a wrapper around reload (untested)?
def my_reload(module):
for k in module.__dict__.keys():
if k in ('__file__', '__name__'): continue
del module.__dict__[k]
return reload(module)
Jeff
- Previous message (by thread): XML, Unicode
- Next message (by thread): Reloading a module
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list