-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-104146: Purge dead code from Argument Clinic #104680
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
Conversation
The following local variables were assigned but never used: - line 551: result - line 1341: groups - line 1431: default_return_converter - line 1529: ignore_self - line 1809: input_checksum - line 4224: new'
Tools/clinic/clinic.py
Outdated
@@ -4245,8 +4237,7 @@ def directive_version(self, required): | |||
fail("Insufficient Clinic version!\n Version: " + version + "\n Required: " + required) | |||
|
|||
def directive_module(self, name): | |||
fields = name.split('.') | |||
new = fields.pop() | |||
fields = name.split('.')[1:] |
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.
pop() removes the last item in the list, no?
fields = name.split('.')[1:] | |
fields = name.split('.')[:-1] |
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.
Good catch. Yes, [1:]
is definitely wrong. Strangely, make clinic
does not complain or generate incorrect.
Would you be interested in possibly running pyflakes on Tools/clinic/ in CI, to catch this kind of thing in the future? It's a linter that tries extremely hard to have 0 false positives, and didn't have any hits on Tools/clinic/ other than the ones that are being fixed here |
I think that's a good idea. Others might disagree :) |
I can open an issue and we can see if anybody objects! |
The following local variables were assigned but never used: