-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Returning Unknown
instead of Any
for incomplete __getattr__
#13765
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
Labels
project: policy
Organization of the typeshed project
stubs: false negative
Type checkers do not report an error, but should
Comments
I think that was a pattern mandated in CONTRIBUTING for incomplete stubs. I think the current pattern just happened via the route
That said, I don't have a strong preference either way. |
srittau
added a commit
to srittau/typeshed
that referenced
this issue
May 12, 2025
tsibley
added a commit
to nextstrain/cli
that referenced
this issue
May 23, 2025
An included typeshed stub update¹ for docutils (and many other modules) meant that docutils.readers.standalone.Reader became an unknown type and was duly reported as such. We don't care. An apparent regression² results in unnecessary "# type: …" comments in the typeshed itself's internal code being reported as our problem. It is not. Ignore them. ¹ <python/typeshed#13765> <python/typeshed#14030> ² <microsoft/pyright#10487>
tsibley
added a commit
to nextstrain/cli
that referenced
this issue
May 23, 2025
An included typeshed stub update¹ for docutils (and many other modules) meant that docutils.readers.standalone.Reader became an unknown type and was duly reported as such. We don't care. An apparent regression² results in unnecessary "# type: …" comments in the typeshed itself's internal code being reported as our problem. It is not. Ignore them. Note that in this case of ignoring out-of-project source, matching an absolute path seems to be required for the Pyright "ignore" pattern to actually work. (I found no relative or partial paths that work.) Also note that whatever globbing Pyright is doing will not match a leading "**" to an absolute path. Give up and anchor the pattern to an absolute root separately for POSIX and Windows. Yay. ¹ <python/typeshed#13765> <python/typeshed#14030> ² <microsoft/pyright#10487>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
project: policy
Organization of the typeshed project
stubs: false negative
Type checkers do not report an error, but should
Uh oh!
There was an error while loading. Please reload this page.
I noticed we have quite a few
Wouldn't it be better to write as
So that type-checkers like Pyright in strict mode can warn about unknown types ?
The text was updated successfully, but these errors were encountered: