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

No inlay hints for __call__ method #6795

Open
LibrarristShalinward opened this issue Dec 24, 2024 · 1 comment
Open

No inlay hints for __call__ method #6795

LibrarristShalinward opened this issue Dec 24, 2024 · 1 comment
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@LibrarristShalinward
Copy link

Environment data

  • Language Server version: 2024.12.1
  • OS and version: win32 x64
  • Python version (and distribution if applicable, e.g. Anaconda): 3.9.18
  • python.analysis.indexing: true
  • python.analysis.typeCheckingMode: off

Code Snippet

Inlay hints are not be able to generated for __call__ methods of classes when calling them with {class object name}(...) outside the class (even after enabling all of the type hint options of pylance).
Just take the simple code below as an example:

class Foo: 
    def __init__(self):
        pass

    def __call__(self, a: int, b: float) -> str: 
        return "%i, %.2f" %(a, b)

foo = Foo()
c = foo(3, 4.2)

Expected behavior

for the last line, something like:

c":str" = foo("a="3, "b="4.2)

Actual behavior

c":str" = foo(3, 4.2)

Image

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Dec 24, 2024
@bschnurr
Copy link
Member

bschnurr commented Jan 7, 2025

thanks for logging an issue. I'll look into it

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