Skip to content

Remove unused internal code#5041

Merged
JelleZijlstra merged 3 commits intopsf:mainfrom
duriantaco:remove-dead-code
Mar 11, 2026
Merged

Remove unused internal code#5041
JelleZijlstra merged 3 commits intopsf:mainfrom
duriantaco:remove-dead-code

Conversation

@duriantaco
Copy link
Contributor

@duriantaco duriantaco commented Mar 11, 2026

Hello,

Just doing some cleanup. Removed four internal items that are defined but never referenced anywhere in the codebase:

  • matches_grammar() in parsing.py —> utility function with zero callers
  • lib2to3_unparse() in parsing.py —> utility function with zero callers
  • is_function_or_class() in nodes.py —> function with zero callers (note: is_parent_function_or_class nearby is still
    used)
  • Deprecated in mode.py — warning class never raised or referenced

Verified with grep across all file types — each appears only at its definition.

Found during static analysis with Skylos.

Checklist

  • Implement any code style changes under the --preview style?
  • Add an entry in CHANGES.md if necessary?
  • Add / update tests if necessary?
  • Add new / update outdated documentation?

@github-actions
Copy link
Contributor

github-actions bot commented Mar 11, 2026

diff-shades results comparing this PR (d5f8b53) to main (0dae20b):

--preview style: no changes

--stable style: no changes


What is this? | Workflow run | diff-shades documentation

@JelleZijlstra JelleZijlstra added the ci: skip news Pull requests that don't need a changelog entry. label Mar 11, 2026
@duriantaco
Copy link
Contributor Author

Removed the changes.md entry as per reviewer's request

@JelleZijlstra JelleZijlstra merged commit c014b22 into psf:main Mar 11, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci: skip news Pull requests that don't need a changelog entry.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants