Repository navigation
STY: Return None from remove_objects_from_page - #3985
Merged
stefan6419846 merged 1 commit intoAug 20, 2026
Merged
Conversation
`remove_objects_from_page` is declared `-> None` and documented as
returning nothing, but its last line is:
return [], [] # type: ignore[return-value]
The tuple is never used. All four internal callers discard it, as do the
tests, and every other exit from the function returns None or delegates
to `_remove_annots_from_page`, which is itself `-> None`. A runtime
protocol check rejects it, since the value does not match the signature.
Return None instead and drop the ignore.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3985 +/- ##
=======================================
Coverage 97.95% 97.95%
=======================================
Files 57 57
Lines 11043 11043
Branches 2068 2068
=======================================
Hits 10817 10817
Misses 126 126
Partials 100 100 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
stefan6419846
approved these changes
Aug 20, 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.
remove_objects_from_pageis declared-> Noneand documented as returningnothing, but its last line is:
The tuple is never used. All four internal callers discard it, so do the tests,
and every other exit from the function either returns None or delegates to
_remove_annots_from_page, which is itself-> None. A runtime protocol checkrejects it because the value does not match the signature.
Returns None instead, and the ignore goes with it.
return Nonerather than abare
returnto satisfy RET502, matching the early return higher up in thesame function.
Under
make testtypethis is 6 failures in test_writer; they go to 0. mypyreports the same 11 pre-existing errors before and after, and ruff check passes.