Repository navigation
Fill in missing type annotations in the public API - #2563
Merged
Merged
Conversation
jorenham
force-pushed
the
typing/coverage
branch
from
October 27, 2026 11:33
cbaf769 to
439f6ed
Compare
Contributor
Merging this PR will not alter performance1 note
Comparing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2563 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 80 82 +2
Lines 2485 2697 +212
Branches 437 45 -392
==========================================
+ Hits 2485 2697 +212 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
sobolevn
reviewed
Oct 27, 2026
sobolevn
left a comment
Member
There was a problem hiding this comment.
Thanks, please fix merge conflicts.
Co-authored-by: sobolevn <mail@sobolevn.me>
jorenham
force-pushed
the
typing/coverage
branch
from
October 27, 2026 15:50
439f6ed to
46309b8
Compare
2 of 4 tasks
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.
I have annotated things!
Using
uvx pyrefly coverage check --public-only returnsI found a couple of missing annotations in the public API, and filled them in.Some judgement calls:
methods.cond.condis nowFinal, which technically is a restriction. I'm guessingcondwasn't intended to be re-assigned, so this felt appropriate.ReturnsAsserts.is_error_handledtechnically accept type forcontainer, butResultLikeNseemed more appropriate, because passing anything isFalseanyway.Some annotations here might seem a bit silly, and are mostly added to appease
pyrefly coverage check(it returns nonzero if type coverage is below 100%), which could be nice to enforce in CI (like we do at NumPy). It's how I found out about #2559 and #2562, for example, so can be useful IMO. So if you want I could add that to CI (here or as follow-up)?Checklist
CHANGELOG.mdRelated issues
I guess if you squint your eyes, #2048 can be considered related, since this annotated the
__reduce__return type.🙏 Please, if you or your company finds
dry-pythonvaluable, help us sustain the project by sponsoring it transparently on https://github.com/sponsors/dry-python. As a thank you, your profile/company logo will be added to our main README which receives hundreds of unique visitors per day.