-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
False positive unused-import (W0611) when assigning class properties with the same name #6089
Comments
While the original bug introduced by ea13058 really was an issue with the The error is also slightly different: ************* Module a
/Users/andreas/programming/forks/pylint/.notes/a.py:1:0: W0611: Unused x imported from other (unused-import)
/Users/andreas/programming/forks/pylint/.notes/a.py:1:0: W0611: Unused y imported from other (unused-import) With the current main branch, the output only complains about ************* Module a
a.py:1:0: W0611: Unused x imported from other (unused-import) It makes no difference if we short-circuit the |
FWIW, enabling either
Those are the only two rules that seem to make a difference though -- enabling any of the others does not make the issue go away. |
Thanks, this explains why in the current version the This was introduced with c518188 which apparently already aimed at solving similar problems, but did not catch all of them. It explicitly dealt with the I just saw that the issue that this commit fixed was one of yours as well. 😁 |
Thanks guys! |
Bug description
This code snippet
will start raising a false positive from ea13058 up until the current main branch (6505c74).
Related: #4993.
Configuration
No response
Command used
A false positive is only raised in combination with
--disable=all
:But when invoked as
no false positive is raised, even though
unused-import (W0611)
is enabled by default.Pylint output
************* Module mycodesnippet /path/to/mycodesnippet.py:1:0: W0611: Unused x imported from other (unused-import) ------------------------------------------------------------------ Your code has been rated at 7.50/10 (previous run: 7.50/10, +0.00)
Expected behavior
No false positive should be raised.
Pylint version
OS / Environment
macOS 12.3
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: