Skip to content

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commented May 29, 2022

For example:

A[T, *Ts][*tuple[int, ...]] -> A[int, *tuple[int, ...]]
A[*Ts, T][*tuple[int, ...]] -> A[*tuple[int, ...], int]

#91162

…able-size tuple For example: A[T, *Ts][*tuple[int, ...]] -> A[int, *tuple[int, ...]] A[*Ts, T][*tuple[int, ...]] -> A[*tuple[int, ...], int]
@serhiy-storchakaserhiy-storchaka added type-feature A feature request or enhancement needs backport to 3.11 only security fixes labels May 29, 2022
@serhiy-storchakaserhiy-storchaka changed the title gh-91162: Support substitution of TypeVar with an unpacked variable-size tuple[WIP] gh-91162: Support substitution of TypeVar with an unpacked variable-size tupleMay 29, 2022
@serhiy-storchakaserhiy-storchaka changed the title [WIP] gh-91162: Support substitution of TypeVar with an unpacked variable-size tuplegh-91162: Support substitution of TypeVar with an unpacked variable-size tupleMay 29, 2022
@serhiy-storchakaserhiy-storchaka marked this pull request as ready for review May 29, 2022 18:49
if (arg){
if (vartuplearg<nitems){
Py_DECREF(arg);
Py_DECREF(fillarg);
Copy link
Member

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.

Copy link
MemberAuthor

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.

@serhiy-storchaka
Copy link
MemberAuthor

See also #93412.

@serhiy-storchakaserhiy-storchaka deleted the typing-subst-unpacked-vat-tuple branch June 12, 2022 13:22
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting mergeneeds backport to 3.11only security fixestype-featureA feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@serhiy-storchaka@JelleZijlstra@bedevere-bot