-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
unused-import
should observe dummy-variables-rgx
setting
#8500
Comments
I have never seen this pattern. How common is this? |
I have seen the get_text alias as I think we should accept this on the basis that Easy picking. Thanks for the report! |
unused-import
when imported as __
unused-import
should observe dummy-variables-rgx
setting
Hello, I've looked into this issue and I'd like to work on it. Thanks! |
`unused-import` now observes `dummy-variables-rgx config` Resolves pylint-dev#8500
`unused-import` now observes `dummy-variables-rgx config` Resolves pylint-dev#8500
Resolve #8500 Co-authored-by: Pierre Sassoulas <[email protected]>
Resolve #8500 Co-authored-by: Pierre Sassoulas <[email protected]> (cherry picked from commit 0cd41b1)
Resolve #8500 Co-authored-by: Pierre Sassoulas <[email protected]> (cherry picked from commit 0cd41b1) Co-authored-by: RSTdefg <[email protected]>
Bug description
Python convention is that any variable name consisting entirely of underscores is to be considered a placeholder, used when a value needs to be assigned somewhere but you don't actually care about it after that. Thus no warnings should be emitted about such a variable being unused, overwritten, or changing type.
However, another common convention is to import the
gettext()
translation function as_
for convenience. Thus current best-practice is to use names of two or more underscores for placeholders.test2.py
:Configuration
No response
Command used
Pylint output
************* Module test2 test2.py:3:0: W0611: Unused prettyprinter imported as __ (unused-import) ------------------------------------------------------------------ Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)
Expected behavior
No
unused-import
should be emitted if the module is imported with a name consisting entirely of underscores.Pylint version
OS / Environment
Win10
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: