Skip to content

(🐞) 1.2 regression invalid error and bad message with Concatenate return value #15086

Closed
@KotlinIsland

Description

@KotlinIsland
from typing import Callable, Concatenate, Generic, ParamSpec, TypeVar

R = TypeVar("R")
P = ParamSpec("P")

def f() -> Callable[[Callable[Concatenate[str, P], R]], Callable[P, R]]:
    def decorator(fn: Callable[Concatenate[str, P], R], /) -> Callable[P, R]:
        ...

    return decorator

playground

Incompatible return value type (got "Callable[[Callable[[str, **P], R]], Callable[P, R]]", expected "Callable[[Callable[[str, **P], R]], Callable[P, R]]")

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