-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-96385: Correctly raise error on [*T, *V]
substitution
#96386
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
Conversation
@@ -1074,7 +1074,7 @@ def __typing_subst__(self, arg): | |||
def __typing_prepare_subst__(self, alias, args): | |||
params = alias.__parameters__ | |||
typevartuple_index = params.index(self) | |||
for param in enumerate(params[typevartuple_index + 1:]): | |||
for param in params[typevartuple_index + 1:]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wow this code was just broken. :-)
Since this is an outright bug maybe it should be backported? (Possibly not in 3.11.0, it's not important enough to disturb RC2, but definitely in 3.11.1.) Also, pinging @serhiy-storchaka as the original author (AFAICT). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
Thanks @sobolevn for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
…honGH-96386) (cherry picked from commit 7517735) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
GH-96407 is a backport of this pull request to the 3.11 branch. |
I think that this was the original intent.
The path is now fully covered:

TypeVarTuple.__typing_prepare_subst__
does not work as intented #96385