Repository navigation
DEV: Remove unused reverse encoding dicts - #3685
Merged
Merged
Conversation
- Remove FieldFlag (constants.py) — IntFlag class never used or imported anywhere - Remove _win_encoding_rev, _mac_encoding_rev, _symbol_encoding_rev, _zapfding_encoding_rev (_codecs/__init__.py) — reverse encoding dicts never referenced anywhere, not in __all__. _pdfdoc_encoding_rev is kept as it is used in generic/_base.py and exported in __all__. Identified via static analysis (zero references across entire codebase for each symbol).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3685 +/- ##
==========================================
- Coverage 97.41% 97.41% -0.01%
==========================================
Files 55 55
Lines 9989 9985 -4
Branches 1833 1833
==========================================
- Hits 9731 9727 -4
Misses 150 150
Partials 108 108 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
stefan6419846
requested changes
Mar 16, 2026
stefan6419846
left a comment
Collaborator
There was a problem hiding this comment.
Please do not mix multiple changes into one PR.
Additionally, removing public attributes requires a deprecation process.
Contributor
Author
|
hi split done.. reverted the FieldFlag change since it's public and would need deprecation. This PR removes the four private _*_encoding_rev dicts which are underscore-prefixed, excluded from all, and unreferenced in the codebase. |
stefan6419846
approved these changes
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Changes
FieldFlagpypdf/constants.py_win_encoding_revpypdf/_codecs/__init__.py__all___mac_encoding_revpypdf/_codecs/__init__.py__all___symbol_encoding_revpypdf/_codecs/__init__.py__all___zapfding_encoding_revpypdf/_codecs/__init__.py__all___pdfdoc_encoding_revis kept — it is used ingeneric/_base.pyand exported in__all__.Test plan
Found with Skylos — dead code detection for Python.