C
Chris S.
Consider the sample case:
## a.py
import d
import b
b.App()
## b.py
from c import C
B = 'B'
class App(object)
ass
## c.py
from d import D
class C(object)
ass
## d.py
from b import B
D = 'D'
Executing a.py will return:
Traceback (most recent call last):
File "a.py", line 1, in ?
import d
File "d.py", line 1, in ?
from b import B
File "b.py", line 1, in ?
from c import C
File "c.py", line 1, in ?
from d import D
ImportError: cannot import name D
I'm assuming this is the result of the circular imports. This isn't a
bug, right? Is there any way around it?
## a.py
import d
import b
b.App()
## b.py
from c import C
B = 'B'
class App(object)
## c.py
from d import D
class C(object)
## d.py
from b import B
D = 'D'
Executing a.py will return:
Traceback (most recent call last):
File "a.py", line 1, in ?
import d
File "d.py", line 1, in ?
from b import B
File "b.py", line 1, in ?
from c import C
File "c.py", line 1, in ?
from d import D
ImportError: cannot import name D
I'm assuming this is the result of the circular imports. This isn't a
bug, right? Is there any way around it?