Skip to content

Fill in missing type annotations in the public API - #2563

Merged
sobolevn merged 2 commits into
dry-python:masterfrom
jorenham:typing/coverage
Oct 27, 2026
Merged

sobolevn merged 2 commits into
dry-python:masterfrom
jorenham:typing/coverage

Conversation

@jorenham

Copy link
Copy Markdown
Contributor

I have annotated things!

Using uvx pyrefly coverage check --public-only returns I found a couple of missing annotations in the public API, and filled them in.

Some judgement calls:

  • methods.cond.cond is now Final, which technically is a restriction. I'm guessing cond wasn't intended to be re-assigned, so this felt appropriate.
  • ReturnsAsserts.is_error_handled technically accept type for container, but ResultLikeN seemed more appropriate, because passing anything is False anyway.

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

  • I have double checked that there are no unrelated changes in this pull request (old patches, accidental config files, etc)
  • I have created at least one test case for the changes I have made
  • I have updated the documentation for the changes I have made
  • I have added my changes to the CHANGELOG.md

Related 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-python valuable, 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.

@codspeed

codspeed Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

1 note

ℹ️ 2 benchmarks have no flamegraph

The flamegraph wasn't generated: the symbols of the profiling trace could not be resolved, because no information about the language frames was collected.

See affected benchmarks

✅ 22 untouched benchmarks


Comparing jorenham:typing/coverage (46309b8) with master (fde4584)

Open in CodSpeed

@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (82ef3ef) to head (46309b8).
⚠️ Report is 655 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sobolevn sobolevn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, please fix merge conflicts.

Comment thread returns/primitives/hkt.py Resolved
Comment thread returns/primitives/laws.py Resolved
Comment thread returns/primitives/laws.py Resolved

@sobolevn sobolevn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@sobolevn
sobolevn merged commit f3a6f54 into dry-python:master Oct 27, 2026
27 checks passed
@jorenham
jorenham deleted the typing/coverage branch October 27, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants