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

オープン
#20,544 コメント 2 件 リアクション 0 件 担当者 1 名 GitHub で見る

@aviralgarg05 がすでに取り組んでいます。

2026年1月9日 から。

bug topic-pep-646
主要言語
Python
スター
20.6k
フォーク
3.3k
PR マージ指標
PR 指標を取得中

説明

*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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。