Discrepancy between spec and tests on indexing TypedDicts with non-literal variables
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 1.8k
- フォーク
- 302
- 平均マージ
- 23時間
- マージ済み PR(30日)
- 8
説明
Splitting issue from PR https://github.com/python/typing/pull/1978
Spec says that it should be generally rejected (ref)
A key that is not a literal should generally be rejected, since its value is unknown during type checking, and thus can cause some of the above violations.
But currently conformance tests do not reflect it.
So in theory to resolve this, either strictness should be reflected in conformance tests or spec should be amended allowing optional enforcement.
Related discussion - https://discuss.python.org/t/indexing-typeddict-with-a-non-literal-variable/88929
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
TypedDict operations spec セクションと、34-38 行目付近の conformance/tests/typeddicts_operations.py から始め、次に PR 1978 とリンクされた議論を読んでください。conformance tests が非リテラルによるインデックス付けを拒否すべきか、それとも仕様で任意の適用を許可すべきかを判断してください。仕様と conformance tests が合意された動作を一貫して記述していれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- documentation, testing
- issue の種類
- ドキュメント
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100