-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrong
Description
Please consider
import typing as tp
P = tp.ParamSpec('P')
def decorator(f: tp.Callable[P, int]) -> tp.Callable[P, int]:
def wrapper(*args: P.args, **kw: P.kwargs) -> int:
print(args[0])
return 0
return wrapper
then
$ mypy t.py
t.py:7: error: Value of type "P.args" is not indexable
Found 1 error in 1 file (checked 1 source file)
I would expect no error, as args
is indexable actually.
Mypy 0.930, Python 3.10.1
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrong