-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
Description
Bug Report
seems dmypy is unable to suggest an annotation when a function is decorated even with a trivial decorator (likely as the implementation predates widespread ParamSpec usage)
I believe the fix is deleting this line?
Line 656 in 454989f
| and isinstance(ct.arg_types[0], TypeVarType) |
To Reproduce
from typing import Callable
def dec[R, **P](f: Callable[P, R]) -> Callable[P, R]:
return f
@dec
def f():
print('hello world')[mypy]
check_untyped_defs = trueExpected Behavior
$ dmypy check .
...
$ dmypy suggest t.f
() -> NoneActual Behavior
$ dmypy check .
...
$ dmypy suggest t.f
Object t.f is a decorator we can't handleYour Environment
- Mypy version used: 1.15.0
- Mypy command-line flags: (see above)
- Mypy configuration options from
mypy.ini(and other config files): (see above) - Python version used: 3.13.1