You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
applying both of these suggestions results in a type error:
$ mypy t.pyt.py:8: error: Return type "str" of "get_key" incompatible with return type "None" in supertype "C" [override]Found 1 error in 1 file (checked 1 source file)
Your Environment
Mypy version used: 1.15.0
Mypy command-line flags: see above
Mypy configuration options from mypy.ini (and other config files): n/a
Python version used: 3.13.1
The text was updated successfully, but these errors were encountered:
dmypy suggest only considers calls and signatures in supertypes, so this logic doesn't consider subclasses and can't help annotate abstract methods. I agree that the easy sane solution is to skip suggesting @abstractmethod signature, or at least avoid suggesting -> None for abstract methods with empty body.
Bug Report
with
--no-errors
the suggestions fromdmypy suggest
for abstract methods can lead to type errorsTo Reproduce
Expected Behavior
either no suggestion or
() -> str
fort.C.get_key
Actual Behavior
applying both of these suggestions results in a type error:
Your Environment
mypy.ini
(and other config files): n/aThe text was updated successfully, but these errors were encountered: