You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee='https://github.com/Fidget-Spinner'closed_at=<Date2021-05-14.14:17:17.921>created_at=<Date2021-05-10.09:41:35.969>labels= ['library', '3.10', '3.11']
title='Remove ParamSpec from __parameters__ of most typing generics'updated_at=<Date2021-07-31.13:36:10.523>user='https://github.com/Fidget-Spinner'
typing.List includes ParamSpec in __parameters__ but the builtin list doesn't. The behavior of the latter is correct, as PEP-612 states that: "As before, parameters_expressions by themselves are not acceptable in places where a type is expected".
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.