The current Unpack alias backport had an issue that it did not resolve correctly during substition.
This PR fixes that the following should hold, or rather that the subscription does not raise a TypeError.
from typing_extensions import TypeVarTuple, Unpack
Ts = TypeVarTuple("Ts")
assert Unpack[Ts][str] is str
This fixes #474 and was solved by simply adding the Python 3.12+ code to the alias classes.
Sitenote: This is only slightly related to #103, the code sample there also did not work in 3.11 after the backport was used. However, the error is not related and still persists for <=3.10.
The current Unpack alias backport had an issue that it did not resolve correctly during substition. This PR fixes that the following should hold, or rather that the subscription does not raise a
TypeError
.This fixes #474 and was solved by simply adding the Python 3.12+ code to the alias classes.
Sitenote: This is only slightly related to #103, the code sample there also did not work in 3.11 after the backport was used. However, the error is not related and still persists for <=3.10.