Mypy should warn about conditions whose value can be deduced
オープン
まだ誰も着手していません。
feature
- 主要言語
- Python
- スター
- 20.6k
- フォーク
- 3.3k
- PR マージ指標
- PR 指標を取得中
説明
Feature
Mypy can warn about left and right operands of conditions its value mypy can deduce. Unfortunately, it cannot do so for conditions consisting of one operand.
Pitch
val = 1337
if val is not None:
pass
if val is not None and True:
pass
Mypy can hint about the pointless left hand operand in the second if. Unfortunately, it does not do so for the first if. Supporting this use case would help the programmer to simplify her code by suggesting conditions to remove.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
and True の例における無意味な左辺オペランドに対する mypy の既存の診断から始め、その診断を生成している実装とテストを見つけてください。単一オペランドのケース if val is not None のカバレッジを追加し、既存の動作を後退させることなく、mypy が削除可能な条件を報告することを確認してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- devtools
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100