-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
Fix pyflakes warnings: variable is assigned to but never used #142294
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
base: main
Are you sure you want to change the base?
Conversation
Example of fixed warning:
Lib/functools.py:690:21: local variable 'oldresult'
is assigned to but never used
| # still adjusting the links. | ||
| root = oldroot[NEXT] | ||
| oldkey = root[KEY] | ||
| oldresult = root[RESULT] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't this one important?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind to elaborate? Important for what?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is the comment just above:
# Empty the oldest link and make it the new root.
# Keep a reference to the old key and old result to
# prevent their ref counts from going to zero during the
# update. That will prevent potentially arbitrary object
# clean-up code (i.e. __del__) from running while we're
# still adjusting the links.which says that we want to keep a reference to the old result before doing the update. I would suggest using a noqa suppression to avoid hitting this one.
Example of fixed warning: