Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
KotlinIsland opened this issue Apr 19, 2023 · 1 comment · Fixed by #15272
Closed
Labels
bug mypy got something wrong topic-paramspec PEP 612, ParamSpec, Concatenate

Comments

@KotlinIsland
Copy link
Contributor

KotlinIsland commented Apr 19, 2023

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]]")
@KotlinIsland KotlinIsland added the bug mypy got something wrong label Apr 19, 2023
@KotlinIsland KotlinIsland changed the title (🐞) bad error messagev with Concatenate (🐞) bad error message with Concatenate Apr 19, 2023
@KotlinIsland KotlinIsland changed the title (🐞) bad error message with Concatenate (🐞) 1.2 regression invalid error and bad message with Concatenate return value Apr 19, 2023
@hauntsaninja hauntsaninja added the topic-paramspec PEP 612, ParamSpec, Concatenate label Apr 24, 2023
@A5rocks
Copy link
Collaborator

A5rocks commented Jun 14, 2023

Yet another thing fixed by #15272, lol

I don't really get how that PR fixes so many issues honestly

hauntsaninja pushed a commit that referenced this issue Aug 9, 2023
- Fixes #15037
- Fixes #15065
- Fixes #15073
- Fixes #15388
- Fixes #15086

Yet another part of #14903 that's
finally been extracted!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong topic-paramspec PEP 612, ParamSpec, Concatenate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants