python / python/mypy

New semantic analyzer: Refactor handling of is_inferred_def & co

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

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

priority-1-normal refactoring semantic-analyzer
主要言語
Python
スター
20.6k
フォーク
3.3k
PR マージ指標
PR 指標を取得中

説明

There are several things that hold information about whether a type of variable should be inferred or not:

  • RefExpr.is_new_def
  • RefExpr.is_inferred_def
  • Var.is_ready
  • Var.is_inferred
  • TypeChecker.is_definition()

Such a variety of things is partially caused by the fact that special definitions like named tuples etc. used to have a Var() to which the lvalue was pointing. With the new analyzer we don't have this, so it would be good to clean-up/refactor the logic around inference after we merge the two analyzers.

See also https://github.com/python/mypy/issues/6453

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

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

はじめの一歩

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

調査の方向性

ファイルやテストは指定されていません。2つのアナライザーを統合した後、RefExpr.is_new_def、RefExpr.is_inferred_def、Var.is_ready、Var.is_inferred、TypeChecker.is_definition() を確認することから始めます。推論状態が一貫して扱われ、特殊な定義に関する古い Var の前提がなくなれば完了です。

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

評価

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

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

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