Mypy ignores typing.no_type_check for nested function redefintions.
オープン
まだ誰も着手していません。
bug
topic-pep-484
- 主要言語
- Python
- スター
- 20.6k
- フォーク
- 3.3k
- PR マージ指標
- PR 指標を取得中
説明
Bug Report
Mypy ignores no_type_check, specifically for nested function redefinitions.

To Reproduce
- Create a nested function.
- Create another nested function in the same name right after it.
- Attempt to suppress it with
@typing.no_type_check.
I've tried to deal with it in many ways, including opening a different bug, to no avail.
Your Environment
- Mypy version used: 0.800
- Mypy command-line flags: --disallow-untyped-defs, --show-column-numbers, --follow-imports=silent, --ignore-missing-imports, --check-untyped-defs
- Mypy configuration options from
mypy.ini(and other config files): Nope - Python version used: 3.9.0
- Operating system and version: Windows 10
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、issue に記載されているネストされた関数の再定義を、Python 3.9.0、mypy 0.800、および記載されたコマンドラインフラグを使って再現します。@typing.no_type_check の動作を確認し、診断結果を比較します。ネストされた再定義に対して意図した抑制が機能すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- devtools
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100