To Reproduce
from collections.abc import Callable
class A:
@staticmethod
def b(c: Callable[[], None]) -> Callable[[], None]:
return c
@A.b
@staticmethod
def c() -> None:
pass
mypy playground
Expected Behavior
Invoking mypy catches error.
Actual Behavior
Success: no issues found in 1 source file
However, at runtime:
NameError: name 'A' is not defined