It is not really called out in PEP 695 but it seems it should be rejected. Consider this example:
from typing_extensions import TypeAliasType, TypeVarTuple, Unpack
Ts = TypeVarTuple("Ts")
Alias1 = TypeAliasType("Alias1", tuple[*Ts], type_params=(Ts,)) # pyright: OK
Alias2 = TypeAliasType("Alias2", tuple[*Ts], type_params=(*Ts,)) # pyright: OK <- false negative?
Alias3 = TypeAliasType("Alias3", tuple[*Ts], type_params=(Unpack[Ts],)) # pyright: Error
I noticed this while adding support to TypeAliasType in mypy python/mypy#16926 which in its current state rejects Alias2 and Alias3 above while pyright only emits an error on Alias3 usage.
versions:
pyright 1.1.350
python 3.11
It is not really called out in PEP 695 but it seems it should be rejected. Consider this example:
I noticed this while adding support to
TypeAliasTypein mypy python/mypy#16926 which in its current state rejectsAlias2andAlias3above while pyright only emits an error onAlias3usage.versions:
pyright 1.1.350
python 3.11