reveal_locals() doesn't show module globals that are annotated
オープン
まだ誰も着手していません。
bug
topic-reveal-type
- 主要言語
- Python
- スター
- 20.6k
- フォーク
- 3.3k
- PR マージ指標
- PR 指標を取得中
説明
Bug Report
reveal_locals() doesn't show module globals that are annotated with type information.
To Reproduce
from typing import List
global_var = [1, 2, 3]
global_var_annotated: List[int] = [1, 2, 3]
reveal_locals()
def foo():
local_var = [1, 2, 3]
local_var_annotated: List[int] = [1, 2, 3]
reveal_locals()
Expected Behavior
A note on the global_var_annotated variable:
note: global_var_annotated: builtins.list[builtins.int]
Actual Behavior
global_var_annotated is missing from the revealed types:
note: Revealed local types are:
note: global_var: builtins.list[builtins.int*]
note: Revealed local types are:
note: local_var: Any
note: local_var_annotated: builtins.list[builtins.int]
Your Environment
- mypy 0.931
- Python 3.7.7
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、提供された Python 再現コードを mypy で実行し、モジュールレベルのアノテーション付きグローバル変数に対する reveal_locals() の処理を調べます。その出力を global_var_annotated に対する期待される注記と比較します。アノテーション付きのモジュールグローバルが含まれ、既存のローカル変数およびアノテーションなしのグローバル変数の出力にリグレッションがないことを確認できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- devtools
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100