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

Inlay hints show ParamSpec as Callable #6748

Open
NCBM opened this issue Dec 7, 2024 · 0 comments
Open

Inlay hints show ParamSpec as Callable #6748

NCBM opened this issue Dec 7, 2024 · 0 comments
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@NCBM
Copy link

NCBM commented Dec 7, 2024

Environment data

  • Pylance version: v2024.12.1
  • OS and version: Linux archlinux 6.12.1-zen1-1-zen x86_64 GNU/Linux
  • Python version (& distribution if applicable, e.g. Anaconda): 3.12.7 from distribution package

Code Snippet

from typing import Callable, reveal_type


class A[**P, R]:
    @classmethod
    def from_fn(cls, fn: Callable[P, R]) -> "A[P, R]": ...


def f(a: int) -> str: ...


b = A[[int], str].from_fn(f)

reveal_type(b)  # Type of "b" is "A[(int), str]"

Expected behavior

The inlay hint should be shown like A[(int), str].

Actual behavior

The inlay hint is shown like A[Callable[[int], Any], str].

Image

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

2 participants