Develop-test-debug cycle

Jeff Shannon jeff at ccvcorp.com
Thu Mar 21 17:48:01 EST 2002


logistix wrote:

> Like Tim said, the module is getting reloaded but instances aren't getting
> re-instantiated.

No, because Dale explicitly deleted and recreated the specific instances in
question.  Actually, what Tim was saying is that it's the

from Wibblemodule import wibble

that's the problem.  Once this is done, reloading Wibblemodule will not change
what wibble is bound to.  Thus, calls to wibble() will still use the old
definition, regardless of how many times Wibblemodule is reloaded.  This is one
more reason that I dislike using 'from <module> import xxx', even when 'xxx' !=
'*'.

One possible fix/workaround, though also possibly a huge pain in the posterior,
is to simply change all references to wibble to use Wibblemodule.wibble.

Another thing that might work:

reload(Wibblemodule)
from Wibblemodule import wibble

By specifically re-importing wibble, this should (I think) re-bind the name to
the new version.

Jeff Shannon
Technician/Programmer
Credit International





More information about the Python-list mailing list