-
-
Notifications
You must be signed in to change notification settings - Fork 30.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
gh-91162: Support substitution of TypeVar with an unpacked variable-size tuple #93330
gh-91162: Support substitution of TypeVar with an unpacked variable-size tuple #93330
Conversation
…able-size tuple For example: A[T, *Ts][*tuple[int, ...]] -> A[int, *tuple[int, ...]] A[*Ts, T][*tuple[int, ...]] -> A[*tuple[int, ...], int]
if (arg) { | ||
if (vartuplearg < nitems) { | ||
Py_DECREF(arg); | ||
Py_DECREF(fillarg); |
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.
This could use an assert(fillarg)
to make sure it's not NULL.
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.
Py_DECREF()
makes sure that the argument is not NULL. The result is the same -- a crash.
See also #93412. |
… into typing-subst-unpacked-vat-tuple
For example:
A[T, *Ts][*tuple[int, ...]]
->A[int, *tuple[int, ...]]
A[*Ts, T][*tuple[int, ...]]
->A[*tuple[int, ...], int]
#91162