Repository navigation
MAINT: Use full class names for pypdf.constants imports - #4402
Open
zeyadrabie wants to merge 1 commit into
Open
zeyadrabie wants to merge 1 commit into
zeyadrabie wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4402 +/- ##
==========================================
- Coverage 98.87% 98.87% -0.01%
==========================================
Files 59 59
Lines 12297 12277 -20
Branches 2342 2342
==========================================
- Hits 12159 12139 -20
Misses 68 68
Partials 70 70 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
stefan6419846
requested changes
Nov 12, 2026
stefan6419846
left a comment
Collaborator
There was a problem hiding this comment.
Please review the merge conflicts.
zeyadrabie
force-pushed
the
import-constants-full-names
branch
from
November 13, 2026 00:15
fa55dda to
4036b4d
Compare
This branch has not been deployed
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.
This covers item 1 of #3653: using full class names instead of short aliases when importing from
pypdf.constants.What changed
The code imported its constants under short names like
PGandFT, so when you ran into something likePG.CONTENTSyou had to scroll up to the imports to see whatPGwas. I replaced those aliases with the full class names, so it now readsPageAttributes.CONTENTS.What I left alone
Aliases that aren't constants, like
ChainMap as ChainMapType, are still there. They're outside item 1, so I kept this PR to just the constants.Checks
ruff, mypy, all the pre-commit hooks and the full test suite pass locally. The test run included the downloaded sample files, so it covers the same tests as CI.
AI disclosure
I used Claude Code with Claude Opus 5.5. It did the rename with a script, wrapped the long lines and ran the checks. I reviewed the full diff before opening this PR.