python-trio / trio

Trio – a friendly Python library for async concurrency and I/O
https://trio.readthedocs.io
Other
5.98k stars 325 forks source link

Remove incorrect `str` possibility from HostnameResolver.getaddrinfo #2964

Closed tjstum closed 4 months ago

tjstum commented 4 months ago

_socket.getaddrinfo takes care of encoding all passed in str host arguments before passing it to a custom resolver. Additionally, the docs say that a resolver will always receive IDNA-encoded bytes.

However, the type hints of HostnameResolver.getaddrinfo imply that a resolver may need to contend with a str

Remove the extraneous appearance

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.64%. Comparing base (accaae4) to head (adcf46f).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2964 +/- ## ======================================= Coverage 99.64% 99.64% ======================================= Files 117 117 Lines 17634 17634 Branches 3172 3172 ======================================= Hits 17572 17572 Misses 43 43 Partials 19 19 ``` | [Files](https://app.codecov.io/gh/python-trio/trio/pull/2964?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-trio) | Coverage Δ | | |---|---|---| | [src/trio/\_abc.py](https://app.codecov.io/gh/python-trio/trio/pull/2964?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-trio#diff-c3JjL3RyaW8vX2FiYy5weQ==) | `100.00% <ø> (ø)` | | | [...c/trio/\_tests/test\_highlevel\_open\_tcp\_listeners.py](https://app.codecov.io/gh/python-trio/trio/pull/2964?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-trio#diff-c3JjL3RyaW8vX3Rlc3RzL3Rlc3RfaGlnaGxldmVsX29wZW5fdGNwX2xpc3RlbmVycy5weQ==) | `100.00% <ø> (ø)` | | | [src/trio/\_tests/test\_highlevel\_open\_tcp\_stream.py](https://app.codecov.io/gh/python-trio/trio/pull/2964?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-trio#diff-c3JjL3RyaW8vX3Rlc3RzL3Rlc3RfaGlnaGxldmVsX29wZW5fdGNwX3N0cmVhbS5weQ==) | `100.00% <ø> (ø)` | | | [src/trio/\_tests/test\_highlevel\_ssl\_helpers.py](https://app.codecov.io/gh/python-trio/trio/pull/2964?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-trio#diff-c3JjL3RyaW8vX3Rlc3RzL3Rlc3RfaGlnaGxldmVsX3NzbF9oZWxwZXJzLnB5) | `100.00% <ø> (ø)` | | | [src/trio/testing/\_fake\_net.py](https://app.codecov.io/gh/python-trio/trio/pull/2964?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-trio#diff-c3JjL3RyaW8vdGVzdGluZy9fZmFrZV9uZXQucHk=) | `100.00% <ø> (ø)` | |
jakkdl commented 4 months ago

thanks! Surprised there haven't been more typing errors that snuck through.

CoolCat467 commented 4 months ago

Type checker must be working well!

tjstum commented 4 months ago

Thanks everyone!

I realize I forgot a changelog entry. Does this warrant one, or is it too small to care?

jakkdl commented 4 months ago

Thanks everyone!

I realize I forgot a changelog entry. Does this warrant one, or is it too small to care?

I guess it technically is a public-facing change, but I think it's probably too small to care.