python 3.2 - imported module.submodule namespaces interfering with eachother -
so i'm pretty deep making custom job/process custom manager module, , when got integrating came across interaction hadn't seen before modules , namespaces.
code speaks better words:
so there 2 different scripts:
test1:
import jobmanager jobmanager.jobmap = {'test1':'test123'}
and test2:
import jobmanager jobmanager.jobmap = {'test2':'test222'}
top level script:
import test1 import test2 print(test1.jobmanager.jobmap) print(test2.jobmanager.jobmap)
so when run top level script prints:
{'test2':'test222'} {'test2':'test222'}
but expected output is:
{'test1':'test123'} {'test2':'test222'}
is case test1.jobmanager , test2.jobmanager same namespace? there way keep them separate?
is case test1.jobmanager , test2.jobmanager same namespace?
yes.
is there way keep them separate?
not without creating module.
Comments
Post a Comment