-
Notifications
You must be signed in to change notification settings - Fork 179
fix auto complete dict key when possible #1189 #1515
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
base: main
Are you sure you want to change the base?
Conversation
| items: int | ||
| td: TD = {'items': 1} | ||
| assert_type(td['items'], int) | ||
| assert_type(td['items'], Literal[1]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this mean it's harder to add items to a typeddict (i.e. all additions must be literal[1] and not int?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so td['items'] = 2 will fail but td['items'] = a int value will pass now. A bit too strict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asukaminato0721 could we factor just the facet narrows out into a separate PR?
There's a lot of lsp logic in this change, but the typing implications are - I think - entirely due to the new facet narrows and we could focus on those separately
fix #1189
Introduced dict key completions: added facet chains and literal facet propagation.