GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-104146: Purge dead code from Argument Clinic by erlend-aasland · Pull Request #104680 · python/cpython

Conversation

@erlend-aasland

@erlend-aasland erlend-aasland commented May 20, 2023 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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'
  • Issue: Remove dead code from clinic.py #104146

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@erlend-aasland
pythongh-104146: Purge dead code from Argument Clinic
9395dd7
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'
@erlend-aasland erlend-aasland added the skip news label May 20, 2023
@erlend-aasland
erlend-aasland requested a review from AlexWaygood May 20, 2023 09:37
@bedevere-bot bedevere-bot added the awaiting core review label May 20, 2023
@bedevere-bot bedevere-bot mentioned this pull request May 20, 2023
Remove dead code from clinic.py #104146
Closed
@erlend-aasland erlend-aasland linked an issue May 20, 2023 that may be closed by this pull request
Remove dead code from clinic.py #104146
Closed
AlexWaygood
AlexWaygood reviewed May 20, 2023
View reviewed changes
Comment thread Tools/clinic/clinic.py Outdated
def directive_module(self, name):
fields = name.split('.')
new = fields.pop()
fields = name.split('.')[1:]

@AlexWaygood AlexWaygood May 20, 2023

Copy link
Copy Markdown
Member

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?

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@erlend-aasland erlend-aasland May 20, 2023

Copy link
Copy Markdown
Contributor Author

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

AlexWaygood reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@erlend-aasland
Use pop, but discard value
09c8df4
@AlexWaygood

AlexWaygood commented May 20, 2023

Copy link
Copy Markdown
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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland

erlend-aasland commented May 20, 2023

Copy link
Copy Markdown
Contributor Author

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 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AlexWaygood

AlexWaygood commented May 20, 2023

Copy link
Copy Markdown
Member

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

erlend-aasland reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

AlexWaygood
AlexWaygood approved these changes May 20, 2023
View reviewed changes
Comment thread Tools/clinic/clinic.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels May 20, 2023
@AlexWaygood
use slices
396f0df
@AlexWaygood
AlexWaygood enabled auto-merge (squash) May 20, 2023 10:28
@AlexWaygood
AlexWaygood merged commit ae147d0 into python:main May 20, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label May 20, 2023
@erlend-aasland
erlend-aasland deleted the clinic/the-purge branch May 20, 2023 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@AlexWaygood AlexWaygood AlexWaygood approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Remove dead code from clinic.py

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@erlend-aasland @AlexWaygood @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.