python / python/mypy

mypy should give error at the timing when the type alias set multiple `TypeVarTuple`-based type parameters is defined but not used

Aperta
#20,544 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.