-
-
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
Moving typing_extensions stubs to typing_extensions #7912
Comments
Unfortunately I'm not sure this is feasible. The builtins stubs extensively use Relatedly, it means if we use typing-extensions features in typeshed, we're breaking compatibility with users who have older versions of typing-extensions installed locally. |
Yes, the interdependencies between the stdlib and typing_extensions are one of the biggest problems. What do you think of maintaining the stubs at the typing_extensions repository at least, and copying them over to typeshed? I don't think this would require extra steps compared to now, but might make it a bit easier to keep them in sync. |
I'm not sure what we'd gain from that. Keeping things in two places introduces a risk that they'll go out of sync, and people who contribute to typing-extensions don't have much trouble contributing to typeshed too. |
Strong -1 on this. Note that we can't automatically guarantee typing_extensions is installed at all when users specify |
I absolutely agree that, in general, it's good to keep stubs close to the implementation. But I'm with @JelleZijlstra and @hauntsaninja on this —
This seems like it would be viable but, like Jelle, I don't really see the benefit of doing this. It feels like it would just be extra busywork to have to maintain identical stubs in two separate repos :/ |
I think the consensus is that we shouldn't do this. |
This is not an easy problem, and I don't expect that we will fix this soon. But I'd like to at least start a discussion about ways to move the typing_extensions stubs over to the typing_extensions repository. The advantages are the usual advantages for having stubs:
This is a difficult problem, since we kind of need to assume that typing_extensions is installed. Even the stdlib stubs use it for newer typing features. I assume moving the stubs over wouldn't be much of a problem for Python-based type checkers like mypy, since they install the package anyway, but it could be a problem for non-Python based typing checkers.
One first step could be to add the stubs to the typing_extensions repository and ship them with the library (plus
py.typed
), but copy them over to _typeshed whenever they change. That way they would at least be maintained in the right place, and I don't think it would be extra work compared to now.The text was updated successfully, but these errors were encountered: