-
-
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
Typecheck typeshed's code with pyright #9793
Conversation
This comment has been minimized.
This comment has been minimized.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
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 agree with everything Jelle said; here's a few more pieces of feedback
…m/typeshed into pyright-typecheck-typeshed
Co-authored-by: Alex Waygood <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
…m/typeshed into pyright-typecheck-typeshed
Thanks for the reviews and patience! This started absolutely huge that I split off in its own chunks over time. And there was some artefacts of that leftover. |
When it comes to typeshed's own code, it is tested with mypy but not with pyright. A bit odd given how strictly the stubs are tested against pyright. Making typeshed, imo, a bit of a "poorly shod shoemaker" on that aspect.
Pyright specifically complements mypy's missing features well.
But this is not just about typeshed itself. As it is a pillar in Python's typing ecosystem, problems caught by it, and improvements made thanks to it (especially those pushing the limitations of the current type system) have bigger repercussions on the ecosystem as a whole.
Tangible improvements:
All of the PRs and issues mentioned here are directly related, and opened due, to me trying to run pyright on typeshed's own code and working on this PR:
# pyright: ignore
not at the start of a comment microsoft/pyright#4259pyright: ignore
comments, but nottype: ignore
? microsoft/pyright#4243Unknown
when in tuple passed to Iterable with TypeVar parameter microsoft/pyright#4244typing_extension.Self
infers the wrong type from__new__
microsoft/pyright#4668.py
changes in this PRldap3
#9532 (comment)pyrightconfig.json
, add missing comments and extra strict settings in all pyright configs #9714pyright: ignore
and differentiate from mypy ignores #9397dict.get
overload with default value not be generic? #9155termcolor.colored
fallback #9435Loader
parameter inPyYAML/yaml
#9752py.typed
marker cpburnz/python-pathspec#67PathLike
type cpburnz/python-pathspec#75# pyright: ignore[]
used with# type: ignore[]
comments on short lines psf/black#3399IO
python-poetry/tomlkit#272(I waited until most of these got resolved before bringing this PR)