-
Notifications
You must be signed in to change notification settings - Fork 767
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
Parameters for a TypedDict don't show type on hover #3569
Comments
@rchiodo, can you please paste the code in text form? It's inconvenient to retype from a screen shot. |
The below should work and autocomplete/hover correctly— y: Movie2 = {"name": "foo", "year": 4}
# alternative
y: Movie2 = dict(name="foo", year=4) |
@tuchandra, the constructor call in the screen shot above is legal for a TypedDict. The two forms you provided are also supported. |
Here's the code in text form: from typing import TypedDict
class Movie2(TypedDict):
name: str
year: int
y = Movie2(name='foo', year=4)
print(y['name']) |
I agree that the hover text in this case could be improved. Since this is a language server issue, not a core type-checking issue, I'm going to transfer it to pylance-release. |
…nts passed to a TypedDict constructor. This addresses microsoft/pylance-release#3569.
This will be addressed in the next release of pyright and a future release of pylance. |
This issue has been fixed in prerelease version 2022.11.21, which we've just released. You can find the changelog here: CHANGELOG.md |
Note: if you are reporting a wrong signature of a function or a class in the standard library, then the typeshed tracker is better suited for this report: https://github.com/python/typeshed/issues.
Describe the bug
Hover for TypedDicts init does not compute the type
To Reproduce
Steps to reproduce the behavior.
VS Code extension or command-line
VS Code Extension
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: