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

Open
#20,544 2 comments 0 reactions 1 assignee View on GitHub

@aviralgarg05 is already working on this.

Since Jan 9, 2026.

bug topic-pep-646
Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

*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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.