Type remaining _highlevel modules#2756
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #2756 +/- ##
=======================================
Coverage 98.93% 98.94%
=======================================
Files 113 113
Lines 16770 16793 +23
Branches 3027 3030 +3
=======================================
+ Hits 16592 16615 +23
Misses 123 123
Partials 55 55
|
Apparently already being handled in python-trio#2756
jakkdl
left a comment
There was a problem hiding this comment.
add files to pyproject.toml so they're checked in CI.
The types otherwise are kinda beautiful 😍
| # these are not defined in https://docs.python.org/3/objects.inv | ||
| ("py:class", "socket.AddressFamily"), | ||
| ("py:class", "socket.SocketKind"), | ||
| ("py:class", "Buffer"), # collections.abc.Buffer, in 3.12 |
There was a problem hiding this comment.
huh, I'm a bit surprised it's not available in the inv file given that it's in the online docs https://docs.python.org/3.12/library/collections.abc.html#collections.abc.Buffer. But I guess it's just a matter of waiting for the release
There was a problem hiding this comment.
It's in the inv file, but we're linking to /3/ which is still 3.11.
There was a problem hiding this comment.
ah, checks out. If we really wanted to I suppose we could add another source for /3.12/ but that'd probably just lead to problems with duplicated objects or something
* Somehow this did not get in to edbf981 * Add type annotations to `_ssl.py` * Fix for pre-3.10 * Fix CI issues * Update `verify_types.json` * Remove unused imports * Change lots of `Any` to `object` * Update `verify_types.json` * Add `_ssl` to stricker check block and sort modules * Add `trio._abc.T_resource` to doc ignore list * Attempt to fix pyright issues * Update `verify_types.json` * Remove `__slots__` * Update `verify_types.json` * Change to `object` (@A5rocks suggestion) * Fix `server_hostname` * Update `verify_types.json` * Add `_highlevel_ssl_helpers` to stricter checks block * Revert "Add `_highlevel_ssl_helpers` to stricter checks block" This reverts commit 3406eaf. * Revert changes to `_highlevel_ssl_helpers` Apparently already being handled in #2756 * Revert "Update `verify_types.json`" This reverts commit 40e9bf2. * Update `verify_types.json` and fix line endings * Remove slots from exception * Remove `_ssl` from not fully typed block --------- Co-authored-by: CoolCat467 <CoolCat467@users.noreply.github.com> Co-authored-by: jakkdl <h6+github@pm.me>
A bunch of little things that weren't typed yet. I did make one functional change: adding a
lengthparameter toSocketStream.setsockopt()to match the underlying socket. I believetrio.serve_listeners()requires higher kinded types / generic typevar bounds to actually be typed correctly, currently it allows passing a handler that doesn't match the listener's results.