-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Move some types from _typeshed to typing_extensions #5912
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
Comments
This is a little bit tricky if we're hoping to have stdlib types depend on this. E.g., we run into the same issues that caused us to pretend typing_extensions is part of the stdlib (what happens if users don't install |
Type checkers would need to depend on this package. |
It could still lead to problems, e.g. with mypy's |
Since I'd expect type checkers to depend on the correct types-typeshed version, pinning it by the user should conflict when pip installing, so this would lead to an impossible situation. |
Typeshed stubs don't have to use this package -- we could continue to have Another option would be to use the public package in third-party stubs but not in stdlib stubs. Here the motivation would be that type checkers may ship a too old version of the |
+1 for this. It feels more sane to write |
Can we re-use typing_extensions for this? I feel like that could be less likely to cause confusion for users / typing_extensions already has things like |
I think using typing-extensions would be the best idea. |
Yes, using typing-extensions makes sense to me. In the docs we should make a clear distinction between the backports and utilities parts of typing-extensions though. |
We could put the custom types in a sub-package. |
Could |
This now exists as https://github.com/hauntsaninja/useful_types |
I wonder if we should have a third-party module on PyPI with only useful type definitions / aliases that can be more cleanly used in user code than importing from
_typeshed
. Unliketyping_extensions
, these wouldn't introduce any new type system features -- it would all be just for convenience. And unliketyping_extensions
, we could add arbitrary things not intyping
.Originally posted by @JukkaL in #5910 (comment)
The text was updated successfully, but these errors were encountered: