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

The first argument to Callable must be a list of types, parameter specification, or "..." when using a ParamSpec instance #13067

Closed
multimeric opened this issue Jul 4, 2022 · 2 comments
Labels
bug mypy got something wrong topic-paramspec PEP 612, ParamSpec, Concatenate

Comments

@multimeric
Copy link

Bug Report

Callable[SomeParamSpec] throws a spurious error.

(A clear and concise description of what the bug is.)

To Reproduce

from typing import Callable, ParamSpec, Any

Spec = ParamSpec("Spec")
T = Callable[Spec, Any]

Expected Behavior
This should not result in any error.

(Write what you thought would happen.)

Actual Behavior

main.py:4: error: The first argument to Callable must be a list of types, parameter specification, or "..."
main.py:4: note: See https://mypy.readthedocs.io/en/stable/kinds_of_types.html#callable-types-and-lambdas

(Write what happened.)

Your Environment

  • Mypy version used: Any
  • Python version used: Any

Playground: https://mypy-play.net/?mypy=latest&python=3.10&gist=d01c84f502d89076345cd8f8502ec039

@multimeric multimeric added the bug mypy got something wrong label Jul 4, 2022
@AlexWaygood AlexWaygood added the topic-paramspec PEP 612, ParamSpec, Concatenate label Jul 4, 2022
@AlexWaygood
Copy link
Member

Duplicate of #11855

@AlexWaygood AlexWaygood marked this as a duplicate of #11855 Jul 4, 2022
@AlexWaygood AlexWaygood closed this as not planned Won't fix, can't repro, duplicate, stale Jul 4, 2022
@AlexWaygood
Copy link
Member

Duplicate of #11855

Type aliases generic over a ParamSpec don't work yet: that's a bug (#11855).

The bad error message is another issue, but that's already been improved upon on the master branch, it just hasn't been released yet :)

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

No branches or pull requests

2 participants