Remove type checker-specific symbols from builtins.pyi and typing.pyi
オープン
まだ誰も着手していません。
stubs: improvement
- 主要言語
- Python
- スター
- 5.1k
- フォーク
- 2.1k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 82
説明
I'm working to get rid of the type checker-specific symbols that currently are in our core stubs but don't exist at runtime. I'll use this issue to track the work needed. This involves changes both to typeshed and to type checkers.
Affected names:
typing._TypedDict. Suggesting to rename to_typeshed.TypedDictFallback. (mypy and pyright)typing._promote->_typeshed._promote(mypy only)typing.AwaitableGenerator->_typeshed.AwaitableGenerator(mypy and pyright)builtins.function(mypy and pyright). Need to look more into why we can't just usetypes.FunctionType.- Working on this in mypy but it requires updating a ton of test cases
builtins.ellipsis(mypy and pyright). Should add a new name to _typeshed, similar toNoneType.
builtins.module was also mentioned in the past but it's been fixed already (mypy PR: https://github.com/python/mypy/pull/3107).
Linked issues and PRs:
- #2999
- #3556
- #3932
- python/mypy#11564
- python/mypy#8240
- https://github.com/python/mypy/issues/2765
- https://github.com/python/mypy/issues/8699
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
builtins.pyi と typing.pyi から始め、必要な置き換えを理解するために、リンクされている typeshed と type-checker の issue を確認してください。影響を受ける mypy と pyright の動作およびテストケース、特に builtins.function のケースを確認してください。type-checker 固有のシンボルがコアスタブから削除され、影響を受ける type-checker のテストがパスすれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- tooling
- issue の種類
- リファクタリング
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 活発
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100