Skip to content

Fix type hints in client.py - #623

Open
Repiteo wants to merge 4 commits into
graphql-python:masterfrom
Repiteo:client-type-hints
Open

Repiteo wants to merge 4 commits into
graphql-python:masterfrom
Repiteo:client-type-hints

Conversation

@Repiteo

@Repiteo Repiteo commented Dec 3, 2026

Copy link
Copy Markdown

Fixes a handful of type hint discrepancies in client.py. Most pertinently: it'll make type hints for with client as x work as expected. No functional changes were made in this PR

@codecov

codecov Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (7fb869a) to head (81af05b).
⚠️ Report is 83 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##            master      #623    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           38        40     +2     
  Lines         2908      3336   +428     
==========================================
+ Hits          2908      3336   +428     

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

@leszekhanusz

Copy link
Copy Markdown
Collaborator

Thanks.

Here are some remarks:

  • please explain the bool=... changes or remove them
  • remove the # type: ignore and instead use asserts
  • _connection_loop should return NoReturn instead of None

See Claude review

@Repiteo

Repiteo commented Dec 3, 2026

Copy link
Copy Markdown
Author

I was under the impression that T=... is how one is meant to handle a fallback overload for a variable with a default value, but that could be stylistic more than functional. I'm fine removing those changes outright

It also seems the new mypy errors come from the test files no longer having ambiguous with scopes. Which, granted, was the intent; but I should've done a pass on that before the initial push. Updated version coming shortly

@Repiteo
Repiteo force-pushed the client-type-hints branch 2 times, most recently from bb03055 to c02cca7 Compare December 3, 2026 18:11
@leszekhanusz

Copy link
Copy Markdown
Collaborator

I noticed that some of the typing errors were unrelated to this PR, and I fixed them in another PR then I used Claude to fix the remaining typing issues.

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.

2 participants