What will happen if two modules import each other?
To generalize the problem, what about the cyclic imports in Python?
I got an example here that struck me!
foo.py
import bar
class gX(object):
g = 10
bar.py
from foo import gX
o = gX()
main.py
import foo
import bar
print "all done"
At the command line: $ python main.py
Traceback (most recent call last):
File "m.py", line 1, in
import foo
File "/home/xolve/foo.py", line 1, in
import bar
File "/home/xolve/bar.py", line 1, in
from foo import gX
ImportError: cannot import name gX