You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The statement from .f1 import * within an __init__.py method imports f1 and assigns a reference to the f1 module to the local symbol f1. The f1 module imports f2 from the __init__.py module. So this is an actual cyclical import.
The cycle detection code in pyright is admittedly strict about what constitutes an import cycle. It will detect cycles that do not necessarily result in runtime exceptions. That's intended. If you want to use this diagnostic check, you'll need to factor your code to avoid all cycles.
Describe the bug
Pyright reports a cyclic import within
__init__.py
when a star-import includes an imported module at the same level.To Reproduce
Reported as cyclical import:
No cyclical import reported:
Expected behavior
Neither scenario reported as cyclical.
VS Code extension or command-line
VS Code extension - pylance v2022.3.4
The text was updated successfully, but these errors were encountered: