-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Summary
My example is the following package structure where package.subpackage.module imports from package.module and visa-versa.
.
├── package
│ ├── __init__.py
│ ├── module.py
│ └── subpackage
│ ├── __init__.py
│ └── module.py
└── run.py
run.py
from package.module import Anythingpackage/subpackage/module.py
from package.module import Anything
class Thing:
passpackage/module.py
from package.subpackage.module import Thing
class Anything:
passExpected behaviour
I consider this a circular import but pycycle detects no errors.
Executing run.py results in a circular import error:
Traceback (most recent call last):
File "run.py", line 1, in <module>
from package.module import Anything
File "/home/dom/Code/package/package/module.py", line 1, in <module>
from package.subpackage.module import Thing
File "/home/dom/Code/package/package/subpackage/module.py", line 1, in <module>
from package.module import Anything
ImportError: cannot import name 'Anything' from 'package.module' (/home/dom/Code/package/package/module.py)
An archive containing the package structure and code.
package.tar.gz
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels