-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
bpo-46685: improve test coverage of Self
and Never
in typing
#31222
Conversation
While you're fixing tests, would you mind renaming the |
On second thought, maybe not: if we make that change we should do it in the bugfix branches too, but the rest of this PR is only applicable to 3.11. |
@JelleZijlstra by the way, while working on I can send a PR with it, if others think it is a good idea. I personally think, that it is! Because it can help us catching problems with public / not-exported names in the future. |
Backport of python/cpython#30842, with additional tests from @sobolevn's python/cpython#31222.
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.
Thanks.
There are other typeforms where the _type_check
path is untested too, and not just special forms. For the most part you can test all of them with stringification+get_type_hints
. I'd been thinking lately about the best idea for fixing this coverage gap but haven't gotten to it.
The only one I'm currently aware of that fails such a check are ParamSpec's P.args
and P.kwargs
. I have a bpo open for this from the Annotated
side of the bug, but it's the same problem. I will fix it when that stuff gets hashed out. But, I fixed 3 or so other bugs that would have been caught by these types of tests over the past 2 weeks, so there may be more 👀
Backport of python/cpython#30842, with additional tests from @sobolevn's python/cpython#31222.
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.
I am planning to merge in a few days (cc @gvanrossum).
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.
+1
Backport of python/cpython#30842, with additional tests from @sobolevn's python/cpython#31222.
Backport of python/cpython#30842, with additional tests from @sobolevn's python/cpython#31222.
Backport of python/cpython#30842, with additional tests from @sobolevn's python/cpython#31222.
https://bugs.python.org/issue46685