erroneous complaint that overloaded function implementation does not accept all possible arguments of signature
オープン
まだ誰も着手していません。
bug
false-positive
topic-overloads
- 主要言語
- Python
- スター
- 20.6k
- フォーク
- 3.3k
- PR マージ指標
- PR 指標を取得中
説明
Bug Report
Erroneous complaint that overloaded function implementation does not accept all possible arguments of signature.
To Reproduce
from datetime import datetime
from typing import overload
class Sample:
@overload
@classmethod
def set(cls, year: int) -> None:
...
@overload
@classmethod
def set(cls, instance: datetime, / ) -> None:
...
@classmethod
def set(cls, *args: datetime | int, **kw: int) -> None:
pass
Expected Behavior
The above should pass type checking.
Pyright's happy enough:
$ pyright typing_bug.py
0 errors, 0 warnings, 0 informations
Actual Behavior
$ mypy typing_bug.py
typing_bug.py:16: error: Overloaded function implementation does not accept all possible arguments of signature 1 [misc]
Found 1 error in 1 file (checked 1 source file)
Your Environment
- Mypy version used:
1.14.1 (compiled: yes) - Mypy command-line flags: None, see above
- Mypy configuration options from
mypy.ini(and other config files): None. - Python version used: Python 3.12.1
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
typing_bug.py の報告を mypy 1.14.1 で再現し、結果を pyright と比較します。classmethod の例に対する overload 実装の互換性チェックを追跡します。完了の条件は、mypy が誤った指摘なしに示されたコードを受け入れ、互換性のない実装に対する妥当な診断を維持することです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- tooling
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100