-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Problem with nonlocal written only falsely reported as unused. #3044
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
Labels
False Positive 🦟
A message is emitted but nothing is wrong with the code
Help wanted 🙏
Outside help would be appreciated, good for new contributors
Minor 💅
Polishing pylint is always nice
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
Milestone
Comments
Thanks @kayhayen for the report. This looks like a slight edge case though as you're relying on the side effect of iteration to set the |
It's from a Nuitka test, I don't think it deserves very much priority, but I think there is something flawed then, a potential write, still is a write, right? |
clavedeluna
added a commit
to clavedeluna/pylint
that referenced
this issue
Sep 27, 2022
Pierre-Sassoulas
pushed a commit
that referenced
this issue
Sep 28, 2022
orSolocate
pushed a commit
to orSolocate/pylint
that referenced
this issue
Oct 1, 2022
Pierre-Sassoulas
pushed a commit
to Pierre-Sassoulas/pylint
that referenced
this issue
Oct 9, 2022
Pierre-Sassoulas
pushed a commit
to Pierre-Sassoulas/pylint
that referenced
this issue
Oct 10, 2022
Pierre-Sassoulas
pushed a commit
that referenced
this issue
Oct 10, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
False Positive 🦟
A message is emitted but nothing is wrong with the code
Help wanted 🙏
Outside help would be appreciated, good for new contributors
Minor 💅
Polishing pylint is always nice
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
Steps to reproduce
The above code in a Nuitka test gives a warning:
Current behavior
I need to put # false alarm, pylint: disable=unused-variable in the loop.
Expected behavior
Since the nonlocal value is being read, it shouldn't be considered unused.
pylint --version output
$ /c/Python37/python -m pylint --version
main.py 2.3.1
astroid 2.2.5
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)]
The text was updated successfully, but these errors were encountered: