Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Session.peer type annotation #522

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cuu508
Copy link
Contributor

@cuu508 cuu508 commented Oct 28, 2024

What do these changes do?

Updates the type annotation for the Session.peer field.

The annotation was "str or None".

I think the correct annotation should be "tuple[str, int] or None" (more in #518)

Are there changes in behavior for the user?

Type annotation changes should not affect code at runtime.

Dependent code could see new mypy warnings if it also uses the old, now incompatible, type annotation.

Related issue number

Fixes: #518

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • tox testenvs have been executed in the following environments:
    • Linux (Ubuntu 24.04) {py312}
    • Windows (7, 10): {py36,py37,py38,py39}-{nocov,cov,diffcov}
    • WSL 1.0 (Ubuntu 18.04): {py36,py37,py38,py39}-{nocov,cov,diffcov}, pypy3-{nocov,cov}, qa, docs
    • FreeBSD (12.2, 12.1, 11.4): {py36,pypy3}-{nocov,cov,diffcov}, qa
    • Cygwin: py36-{nocov,cov,diffcov}, qa, docs
  • Documentation reflects the changes
  • Add a news fragment into the NEWS.rst file

@cuu508 cuu508 marked this pull request as draft October 28, 2024 09:04
Copy link

codecov bot commented Oct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.77%. Comparing base (f40ac96) to head (91d108b).
Report is 37 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #522      +/-   ##
==========================================
- Coverage   97.86%   97.77%   -0.10%     
==========================================
  Files          23       23              
  Lines        5707     5699       -8     
  Branches      764      764              
==========================================
- Hits         5585     5572      -13     
- Misses         76       82       +6     
+ Partials       46       45       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cuu508 cuu508 marked this pull request as ready for review October 28, 2024 10:10
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.

Incorrect type annotation for Session.peer
1 participant