Bug Report
I believe mypy's handling of ParamSpecs is slightly too restrictive. Currently, it validates that there are no args or kwargs after a ParamSpec.args argument other than **kwargs. I believe it's tolerable to have kwargs follow a ParamSpec.args
Related to #18278
To Reproduce
def f5(f: Callable[P, int], *args: P.args, extra_regular_arg: int, **kwargs: P.kwargs) -> int: ... # E: Arguments not allowed after ParamSpec.args
def f6(f: Callable[P, int], *args: P.args, extra_kwarg: int = 123, **kwargs: P.kwargs) -> int: ... # E: Arguments not allowed after ParamSpec.args
Expected Behavior
The first function above should continue to fail, while the second function should not throw an error
Bug Report
I believe mypy's handling of
ParamSpecsis slightly too restrictive. Currently, it validates that there are no args or kwargs after aParamSpec.argsargument other than**kwargs. I believe it's tolerable to have kwargs follow aParamSpec.argsRelated to #18278
To Reproduce
Expected Behavior
The first function above should continue to fail, while the second function should not throw an error