mypy should give error at the timing when the type alias set multiple `TypeVarTuple`-based type parameters is defined but not used
Aperta
@aviralgarg05 ci sta già lavorando.
Dal 9/1/2026.
bug
topic-pep-646
- Lingua principale
- Python
- Stelle
- 20.6k
- Fork
- 3.3k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
*Memo:
- mypy test.py
- mypy 1.19.1
- Python 3.14.0
Defining the type alias set multiple TypeVarTuple-based type parameters, mypy doesn't give error while mypy gives the error, when using the type alias as shown below so mypy should give error at the timing when the type alias set multiple TypeVarTuple-based type parameters is defined but not used:
*Memo:
- pyright and pyrefly give error at the timing when the type alias set multiple
TypeVarTuple-based type parameters is defined.
''' New syntax '''
type TA[*Ts1, *Ts2] = tuple[*Ts1] | tuple[*Ts2] # No error
''' New syntax '''
''' Old syntax '''
# from typing import TypeAlias, TypeVarTuple
# Ts1 = TypeVarTuple('Ts1')
# Ts2 = TypeVarTuple('Ts2')
# TA: TypeAlias = tuple[*Ts1] | tuple[*Ts2] # No error
''' Old syntax '''
v: TA[*tuple[int, ...], *tuple[str, ...]] # Error
error: More than one variadic Unpack in a type is not allowed
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Valutazione
Questa issue non è ancora stata valutata.