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
Pyright does not report all unused imports of modules inside a package.
I have a namespace package package with three modules:
unused-import-false-negative.py only contains import statements.
importpackage.module1# Pylance reports that "package.module1" is not accessedimportpackage.module2# No error reported.importpackage.module3# No error reported.
I would expect all three imports to be reported as unused.
Also, if I refer to package.module2 or package.module3, then the unused import error package.module1 goes away (i.e. Pyright/Pylance reports zero errors).
I got the same results after adding an __init__.py to package.
I get the same results using Pylance v2024.12.100 (pre-release) in VS Code and Pyright 1.1.391 on the command line.
The text was updated successfully, but these errors were encountered:
Pyright does not report all unused imports of modules inside a package.
I have a namespace package
package
with three modules:unused-import-false-negative.py
only contains import statements.I would expect all three imports to be reported as unused.
Also, if I refer to
package.module2
orpackage.module3
, then the unused import errorpackage.module1
goes away (i.e. Pyright/Pylance reports zero errors).I got the same results after adding an
__init__.py
topackage
.I get the same results using Pylance v2024.12.100 (pre-release) in VS Code and Pyright 1.1.391 on the command line.
The text was updated successfully, but these errors were encountered: