Bug Report
With #12386 an issue was closed, that ParamSpec cannot be used as tuples and dicts. However, enumerate is seen as invalid, even if it works.
To Reproduce
fromtyping_extensionsimportParamSpecfromtypingimportCallable, TypeVarP=ParamSpec("P")
R=TypeVar("R")
deffoo(func: Callable[P, R]) ->Callable[P, R]:
def_inner(*args: P.args, **kwargs: P.kwargs) ->R:
x=kwargs.pop("x")
y=enumerate(args)
returnfunc(*args, **kwargs)
return_innerExpected Behavior
It works fine
Actual Behavior
foo.py:10:13: error: Need type annotation for "y" [var-annotated]
y = enumerate(args)
^
foo.py:10:23: error: Argument 1 to "enumerate" has incompatible type "P.args"; expected "Iterable[<nothing>]" [arg-type]
y = enumerate(args)
^
Found 2 errors in 1 file (checked 1 source file)
Your Environment
- Mypy version used: 0.960
- Python version used: 3.7.2
- Operating system and version: SUSE Linux
Bug Report
With #12386 an issue was closed, that ParamSpec cannot be used as tuples and dicts. However, enumerate is seen as invalid, even if it works.
To Reproduce
Expected Behavior
It works fine
Actual Behavior
Your Environment