Skip to content

no error when calling Callable with ParamSpec using Concatenate with not enough args #14571

Closed
@DetachHead

Description

@DetachHead
from typing import Callable, Concatenate, ParamSpec

P = ParamSpec("P")


def decorator(fn: Callable[Concatenate[str, P], None]) -> None:
    fn("value") # runtime TypeError: foo() missing 1 required positional argument: 's2'


@decorator
def foo(s: str, s2: str) -> None:
    ...

playground

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrongtopic-paramspecPEP 612, ParamSpec, Concatenate

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions