We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
from typing import overload class FooIntDescriptor: @overload def __get__(self, instance: None, type: type["Foo"]) -> "FooIntDescriptor": ... @overload def __get__(self, instance: "Foo", type: type["Foo"]) -> int: ... def __get__(self, instance: "Foo" | None, type: type["Foo"]) -> int | "FooIntDescriptor": if instance is None: return self return 3 class Foo: foo: FooIntDescriptor bar: int foo = Foo()
foo.f
and observe the type shown for foo.foo in the autocomplete popup.
foo.foo
The type for foo.foo is shown as int in the autocomplete popup. If you type it out and then hover over it, this type is correctly shown:
int
The type for foo.foo is shown as FooIntDescriptor in the autocomplete popup, like if it was looked up on the class instead of the instance:
FooIntDescriptor
https://gist.github.com/henribru/7e9997261acd33583f85e6a769a5459e
The text was updated successfully, but these errors were encountered:
Thanks for this issue, I can repro in 2024.7.1 version.
Sorry, something went wrong.
Literal
__set__
This remains an issue as of v2024.12.1. Any updates or known work arounds?
KacieKK
No branches or pull requests
Environment data
Code Snippet
Repro Steps
Typeand observe the type shown for
foo.foo
in the autocomplete popup.Expected behavior
The type for
foo.foo
is shown asint
in the autocomplete popup. If you type it out and then hover over it, this type is correctly shown:Actual behavior
The type for
foo.foo
is shown asFooIntDescriptor
in the autocomplete popup, like if it was looked up on the class instead of the instance:Logs
https://gist.github.com/henribru/7e9997261acd33583f85e6a769a5459e
The text was updated successfully, but these errors were encountered: