Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #2703 +/- ##
=======================================
Coverage 98.88% 98.88%
=======================================
Files 113 113
Lines 16482 16483 +1
Branches 3000 3000
=======================================
+ Hits 16299 16300 +1
Misses 126 126
Partials 57 57
|
c79de19 to
b1bcb62
Compare
TeamSpen210
left a comment
There was a problem hiding this comment.
LGTM, though I'm not very experienced with sockets so someone else might want to check that bit.
| def socket(self, family=None, type=None, proto=None): | ||
| def socket( | ||
| self, | ||
| family: socket.AddressFamily | int = socket.AF_INET, | ||
| type: socket.SocketKind | int = socket.SOCK_STREAM, | ||
| proto: int = 0, | ||
| ) -> _SocketType: |
There was a problem hiding this comment.
Meh, I don't really feel comfortable changing away from the =None without knowing why exactly they're here in the first place. Additonally, in typeshed this is how a similar function is defined:
if sys.platform == "win32":
def socketpair(family: int = ..., type: int = ..., proto: int = 0) -> tuple[socket, socket]: ...
else:
def socketpair(
family: int | AddressFamily | None = None, type: SocketType | int = ..., proto: int = 0
) -> tuple[socket, socket]: ...There was a problem hiding this comment.
Actually figuring out the value of the defaults required a bit of digging, and it took me a bit to be certain enough that they were static and not dynamic or something, given that pretty much all default values in typeshed is = .... I wouldn't have set the default values to anything but ... if not for typeright --verifytypes complaining when default values aren't explicit.
Lines 270 to 289 in 315dbed
does have explicit logic for
None though, so reverting the default value to None seems eminently plausible.
Given that we're (to the extent possible) only changing typing, and not any behaviour, I don't think we need to be 100% certain that all the types are correct and I expect some incorrect signatures to slip through, and/or existing weird behavior that surfaces because of previously untyped code now being typechecked, that will require followup PRs/releases. |
|
The failing RTD build is due to |
No description provided.