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

(🐞) Bad error message when using unbound ParamSpec in a Callable #13476

Closed
KotlinIsland opened this issue Aug 22, 2022 · 2 comments
Closed
Labels
bug mypy got something wrong diagnostics topic-paramspec PEP 612, ParamSpec, Concatenate topic-usability

Comments

@KotlinIsland
Copy link
Contributor

KotlinIsland commented Aug 22, 2022

from typing import ParamSpec, Callable

P = ParamSpec("P")
a: Callable[P, None]  # error: The first argument to Callable must be a list of types, parameter specification, or "..."

playground

@KotlinIsland KotlinIsland added the bug mypy got something wrong label Aug 22, 2022
@flaeppe
Copy link

flaeppe commented Aug 22, 2022

Found a similar output in #13403

@ilevkivskyi
Copy link
Member

This example works on master, likely fixed by #15837 (note this declares a generic function that ignores its arguments, consistently with how regular type variables work).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong diagnostics topic-paramspec PEP 612, ParamSpec, Concatenate topic-usability
Projects
None yet
Development

No branches or pull requests

4 participants