Cross-module imports?

Matthias Kaeppler void at void.com
Mon Jan 23 01:42:49 EST 2006


Hi,

I am getting strange errors when I am importing modules cross-wise, like 
this:

# module A
import B
var1 = "x"
B.var2 = "y"

# module B
import A
var2 = "z"
print A.var1

The error messages are not even sane, for example the interpreter 
complains about not finding 'var1' in module A.

Is there a solution to this problem which doesn't involve introducing a 
new module holding the shared objects?

Thanks,
Matthias



More information about the Python-list mailing list