cyclic-dependency

Cyclic module dependencies and relative imports in Python

Cyclic module dependencies and relative imports in Python Question: Suppose we have two modules with cyclic dependencies: # a.py import b def f(): return b.y x = 42 # b.py import a def g(): return a.x y = 43 The two modules are in the directory pkg with an empty __init__.py. Importing pkg.a or pkg.b …

Total answers: 3