Forgetting an import

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Tue Jun 12 15:41:40 EDT 2007


En Tue, 12 Jun 2007 15:03:18 -0300, HMS Surprise <john at datavoiceint.com>  
escribió:

> Thanks for the reloads folks. This is a big help as I am running a
> jython based tool (maxq) and re-starting takes awhile.
>
> Can't seem to make reload work using the form "from dvTime
> import ...". So I am prefacing my calls with the module name now.

This is one of the problems with reload. In that case you would need to  
reload(dvTime) and then re-import all the functions. Using module.function  
avoids that particular problem, as you have noticed.
With classes it gets worse: any previously created instances will still be  
instances of the *old* class. I think that there are some recipes in the  
Python Cookbook about this problem.

-- 
Gabriel Genellina




More information about the Python-list mailing list