-
-
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
_typeshed.Self doesn't work in third-party packages with mypy yet #5751
Comments
I'd say we wait for the next mypy release. We should probably also force mypy to use its bundled typeshed when checking third-party libs instead of typeshed's stdlib from HEAD. |
More generally, if we start using new features in third-party library stubs, older mypy releases will silently start seeing I think that this is a fairly bad -- silently losing type checking precision is a real problem. Here are some ideas about how we could perhaps make this better:
This doesn't affect stdlib stubs, since the assumption is that tools bundle them (in part because of this versioning problem). |
Yet another idea that could work for some tools is to publish point releases with updated |
I'm pretty sure we used to do this and ran into some problematic false negatives as a result. I seem to recall at least something involving the protobuf stubs, maybe someone else remembers better. |
Asking users to pin specific types packages is a good idea anyway. Otherwise builds and CI can easily break, since type changes can be fairly intrusive. That said, we should not ship stubs that are incompatible with the latest released version of one of the major type checkers, which is something we can easily test automatically. But waiting an arbitrary amount of time after that is hard to manage with our limited maintainer resources and slows down typeshed's velocity. It would create quite a bit confusion about which features can be used and which can't. |
I agree with @JelleZijlstra that #6156's problem with |
This is a tricky problem, but I'm not sure there's anything too directly actionable for typeshed in this issue. |
I noticed while investigating #5750 that I got
Any
from a method associated as returning_typeshed.Self
. I tracked down that it is because to mypy 0.910,_typeshed.Self
doesn't exist yet because it's bundling an older version of the stdlib. The problem went away when I manually addedSelf
to the installed stub file for_typeshed
.I see two options:
Self
in third-party packages.Self
in third-party packages for now.The text was updated successfully, but these errors were encountered: