python / python/typing

No way to have individual type variable substitutions in uniform tuples of parametrized types

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

まだ誰も着手していません。

topic: feature
主要言語
Python
スター
1.8k
フォーク
302
平均マージ
23時間
マージ済み PR(30日)
8

説明

Suppose we have:

T = TypeVar('T')
Element = tuple[T]

def fn(elements: tuple[Element, ...]): ...

The problem is that T is forced to be the same for every element, i.e. tuple[tuple[int], tuple[int]] will match, while tuple[tuple[float], tuple[int]] won't. Is there currently any support for this? If not, this would be a worthwhile feature - this would be a big help to get type checking and annotations in ctypes :)

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

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

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

調査の方向性

この issue には、リポジトリのファイル、テスト、実装のエントリーポイントがありません。まず TypeVar/Element の例から始め、tuple[Element, ...] に対する現在の動作を確認してください。完全なコントリビューションには、最初に合意された仕様が必要で、その後に対応する実装とテストが必要になります。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
tooling
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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