Add comments parsing flag to ast.parse

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

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

評価

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

調査の方向性

ast.parse エントリポイントから始め、リンクされている mypy issue と discuss.python.org のディスカッションを読んでください。提案されているインターフェースはまだ確定していません。namespace リストのアプローチと具体的な提案を比較し、そのうえで type: ignore、pyright: ignore、mypy: ignore などのディレクティブに必要な API とパース動作を定義してください。

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

説明

stdlib type-feature

Feature or enhancement

Add a flag to ast.parse that signals it to parse comments for directives given to various static analysis tools like PyRight, MyPy, Pylint, etc.

Pitch

Currently, ast.parse produces directives for type: ignore only, which all type checkers respond to. PyRight reacts to its own special pyright: ignore flag to disambiguate type errors that are specific to it. MyPy cannot easily implement a similar flag since it depends on ast.parse. Yet a mypy: ignore directive is needed.

A concrete interface is proposed here by @jab.

Previous discussion

Discussion here. Guido suggests a passing a list of namespaces the caller is interested in. This would make the function output easier to parse, and possibly more efficient.

主要言語
Python
スター
77.2k
フォーク
36k
平均マージ
1日 9時間
マージ済み PR(30日)
558

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

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

はじめの一歩

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

python/cpython のほかの issue

python/cpython の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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