Module interdependencies

John Thingstad john.thingstad at chello.no
Mon Sep 24 16:13:01 EDT 2001


I have a problem with moduel interdependencies.
I have a package Test and a package Formula (logic language).
There is a module txtTest, and tkTest and both use TestFramework.
Now I am testing Formula.engine with txtTest.
The problem happens when I change TestFramework.

import Test.txtTest as txtTest
import formula.normal as normal

txtTest.run(normal.NormalizeTest)

! bug detected in TestFramework
! TestFramework changed, bug fixed

reload(txtTest)

! still get old bug

import TestFramework
reload(TestFramework)
reload(txtTest)

! still seems to run with old TestFramework definition

To get it right I have to exit the interpreter and restart it.
There has to be a better way to do this.
Any ideas?







More information about the Python-list mailing list