Allow derived classes for str and tuple in WSGI validator
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 36k
- PR マージ指標
- PR 指標を取得中
説明
Feature or enhancement
The WSGI validator could allow anything that inherits from tuple[str, str] for the headers, instead of literally just tuple[str, str] and nothing else.
Pitch
This is so I can use classes that extend str and tuple[str, str] as headers.
Symbolic types that add essentially nothing but a pretty constructor and type checks avoid silly mistakes by encoding intent.
Previous discussion
On IRC I was told about contravariance. https://peps.python.org/pep-0484/#covariance-and-contravariance
I think it might be fine, because no matter which class extending its type I will feed it, it's never coming back, so there is no risk of an item of a less precise type bubbling up to the caller somehow.
Linked PRs
- gh-93640
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず WSGI バリデーターのエントリーポイントを見つけ、開始する前に関連付けられた PR gh-93640 を確認してください。issue では、別の場所で関連する作業が行われていることが示されています。バリデーターが str のサブクラスと tuple[str, str] を受け入れつつ、現在の拒否動作を維持していることを確認してください。意図された派生ヘッダークラスが受け入れられ、既存のバリデーターの動作が引き続きカバーされていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- backend
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100