-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
socket: rework to match docs more closely, improve accuracy on linux #11219
Conversation
Match the documentation more closely Fixes some of python#8101
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Diff from mypy_primer, showing the effect of this PR on open source code: trio (https://github.com/python-trio/trio)
+ src/trio/_socket.py:376: error: Unused "type: ignore" comment [unused-ignore]
|
(This PR might be a little tricky to review, but I'm fairly confident. We check socket with stubtest quite tightly on macOS and Windows, and I've manually confirmed we fix stuff without regressions on Linux. Primer is also good) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, when skimming over it and going by your comment and the primer output. Please merge in a day or two, unless someone else wants to do a deep review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't done a proper review here (and I can't without access to a Linux machine :), but this all looks highly plausible, and I trust your judgement + stubtest!
How many stubtest errors would there be in CI if we removed the blanket allowlist entries for linux now, do you know? Is it low enough that we could remove the blanket entries and just enumerate all the errors? (Doesn't need to be done in this PR, I'm just curious!)
Yes, just enumerating all the errors would be great. There's still quite a few errors... this PR only eliminates ones that are certainly errors, where we're missing things in the stubs. The cases where we're missing things at runtime are trickier, because I don't know whether that's just the Linux machines I have access to or if it's real. So I might try to whittle down what I can, and when I give up I'll just allowlist how many ever are left. |
Match the documentation more closely
Fixes some of #8101 , in particular I no longer see any missing constants on the Linux machines I have access to