Skip to content

Typing cleanups 2 - Make all the handlers inherit from IHandler protocol to remove casts, consolidate tests. - #829

Draft
ThosRTanner wants to merge 5 commits into
python-zk:masterfrom
ThosRTanner:typing_cleanups_2
Draft

ThosRTanner wants to merge 5 commits into
python-zk:masterfrom
ThosRTanner:typing_cleanups_2

Conversation

@ThosRTanner

Copy link
Copy Markdown
Contributor

Fixes #828 (oddly)

Depends on #801

Why is this needed?

This makes the type checking safer and allows us to remove a lot of casting.

Proposed Changes

  • Make all the SequentialHandlers inherit from the IHandler Protocol
  • Clean up the IAsyncResult protocol and uses of it.
  • ...

Does this PR introduce any breaking change?

No.

@codecov

codecov Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.88136% with 48 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.33%. Comparing base (f54c4fd) to head (03b8760).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
kazoo/handlers/gevent.py 8.82% 31 Missing ⚠️
kazoo/handlers/eventlet.py 0.00% 16 Missing ⚠️
kazoo/protocol/connection.py 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #829      +/-   ##
==========================================
- Coverage   94.90%   90.33%   -4.57%     
==========================================
  Files          27       27              
  Lines        3811     3799      -12     
==========================================
- Hits         3617     3432     -185     
- Misses        194      367     +173     

☔ 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.

@ThosRTanner
ThosRTanner force-pushed the typing_cleanups_2 branch 2 times, most recently from d0d5e83 to 03b8760 Compare October 31, 2026 16:51
@ceache

ceache commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

I like cleanup too, thanks for this.
Could you make sure the commit message follow the guideline.

I would also prefer if you put the content in the commit message itself instead of referring to the PR.

E.g. "chore(typing): clean up some of the workarounds from the initial PR
See PR for details
"

Git commit log is our true history, not so much github PRs.

@ceache

ceache commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

There is also opportunity for squashing a couple of these commits, I think.

@ThosRTanner

Copy link
Copy Markdown
Contributor Author

I like cleanup too, thanks for this. Could you make sure the commit message follow the guideline.

I would also prefer if you put the content in the commit message itself instead of referring to the PR.

E.g. "chore(typing): clean up some of the workarounds from the initial PR See PR for details "

Git commit log is our true history, not so much github PRs.

Yeah, sorry, nowhere near finished on this. hence why it's draft

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The unit tests for the 3 sequential handlers should be consolidated.

2 participants