-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
False positive unused-variable
for TYPE_CHECKING
imports
#8696
Labels
C: used-before-assignment
Issues related to 'used-before-assignment' check
False Positive 🦟
A message is emitted but nothing is wrong with the code
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
Milestone
Comments
mbyrnepr2
added a commit
to mbyrnepr2/pylint
that referenced
this issue
May 23, 2023
…in a ``if TYPE_CHECKING:`` block and ``allow-global-unused-variables`` is set to ``no`` in the configuration. Closes pylint-dev#8696
mbyrnepr2
added a commit
to mbyrnepr2/pylint
that referenced
this issue
May 23, 2023
…in a ``if TYPE_CHECKING:`` block and ``allow-global-unused-variables`` is set to ``no`` in the configuration. Closes pylint-dev#8696
mbyrnepr2
added a commit
to mbyrnepr2/pylint
that referenced
this issue
May 31, 2023
…in a ``if TYPE_CHECKING:`` block and ``allow-global-unused-variables`` is set to ``no`` in the configuration. Closes pylint-dev#8696
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
C: used-before-assignment
Issues related to 'used-before-assignment' check
False Positive 🦟
A message is emitted but nothing is wrong with the code
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
Bug description
When
allow-global-unused-variables
is set tofalse
in the configuration, theunused-variable
warning is raised for imports made underTYPE_CHECKING
guard clauses. This behavior seems inconsistent withunused-import
, which is not raised for such cases.Configuration
Command used
Pylint output
Expected behavior
No warnings raised.
Pylint version
OS / Environment
WSL2 Ubuntu 20.04 LTS
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: