Skip to content

Conversation

@erlend-aasland
Copy link
Contributor

@erlend-aaslanderlend-aasland commented May 20, 2023

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'

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'
defdirective_module(self, name):
fields=name.split('.')
new=fields.pop()
fields=name.split('.')[1:]
Copy link
Member

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?

Suggested change
fields=name.split('.')[1:]
fields=name.split('.')[:-1]

Copy link
ContributorAuthor

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.

@AlexWaygood
Copy link
Member

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

@erlend-aasland
Copy link
ContributorAuthor

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 :)

@AlexWaygood
Copy link
Member

I can open an issue and we can see if anybody objects!

@AlexWaygoodAlexWaygood enabled auto-merge (squash) May 20, 2023 10:28
@AlexWaygoodAlexWaygood merged commit ae147d0 into python:mainMay 20, 2023
@erlend-aaslanderlend-aasland deleted the clinic/the-purge branch May 20, 2023 10:53
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove dead code from clinic.py

3 participants

@erlend-aasland@AlexWaygood@bedevere-bot