--disallow-untyped-calls allows calling values with Any type
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 20.6k
- フォーク
- 3.3k
- PR マージ指標
- PR 指標を取得中
説明
The calls to f and ff below aren't rejected when using --disallow-untyped-calls, even though I believe that they should be:
from typing import Any
from non_existent import f # type: ignore # Not in the build
def g(): pass
def h() -> None:
g(asdf=1) # Error: Call to untyped function "g" in typed context
f(asdf=1) # No error reported, but this is untyped
ff: Any
ff() # No error reported, and again this in untyped
At the very least the first call should probably be caught. If non_existent gets added in the build with no type annotations, it would start generating errors. However, I'd expect that adding a module to the build should result in fewer Any-related errors, not more.
Marking this a high priority since I've been bit by this twice in production code.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
--disallow-untyped-calls を指定して issue の Python 例を再現し、その後、import された値および明示的に Any 型が付けられた値を介した呼び出しがどのようにチェックされるかを追跡する。f と ff への呼び出しが拒否され、g に対する既存の診断が変更されなければ完了とする。payload には、開始時に使用するソースファイルもテストも指定されていない。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- compilers, devtools
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 39/100