-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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
Remove ParamSpec from __parameters__ of most typing generics #88264
Comments
https://www.python.org/dev/peps/pep-0612/#valid-use-locations This patch just makes the typing version same as the builtin version by excluding |
All patches have landed. Thanks Guido! |
I think that List[P] should be illegal at first place. |
Yeah, but we shouldn't go out of our way to reject it. Especially since in 3.11 we'll likely have something equivalent to PEP-563 or PEP-649 (the SC is thinking deep about this right now) and either of those means that usually it won't be evaluated at all anyway (you'd have to call get_type_hints() with PEP-563, or use __annotations__ with the other). |
I am writing a patch which generalizes and significantly simplifies the code for type variables and parameter specifications substitution, and opens a way for more runtime validation. But it is incompatible with these changes. |
@serhiy, could you please briefly describe what you are planning? I'm guessing you're generalizing for _TypeVarLike? My main concern is that we should have as few differences between builtin and typing types as possible. typing.List is deprecated and set to remove in Python 3.13/14, so I'm hoping the transition will be fairly painless. Originally, the builtin types supported ParamSpec, but I removed that in #69635 for various reasons listed in that PR. |
See bpo-44796. |
__parameters__
in typing generics #26013__parameters__
in typing generics (GH-26013) #26091Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: