-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Support flexible TypedDict creation/update #15425
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
82f330a
Start working
ilevkivskyi b8b4fa7
Cleanups; update union handling; more tests
ilevkivskyi 7925535
Add inference test case
ilevkivskyi 1aa4218
Add another test case from issue
ilevkivskyi 57f57c4
Handle strictnes also for star items
ilevkivskyi 4d2f961
Allow Any in star unpacks; add one more union test
ilevkivskyi 7b0ecb5
Update test
ilevkivskyi d6ed5cf
Support plain dict syntax as well
ilevkivskyi dbb36fb
Merge remote-tracking branch 'upstream/master' into support-start-td
ilevkivskyi 98cdc48
Address CR
ilevkivskyi 2664bd2
Merge remote-tracking branch 'upstream/master' into support-start-td
ilevkivskyi a98f555
Merge flags and deprecate old one
ilevkivskyi 12fcb4f
Add docs for new flag
ilevkivskyi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update test
- Loading branch information
commit 7b0ecb57c6ab653398fac4a0cfc9b6948edda8a4
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I feel this should be allowed; Any means Any.
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.
I agree with Ivan that for consistency we can only this if the type is
Dict[Any, Any]
. However, I'm not sure ifDict[Any, Any]
is supported in other contexts (need to double check).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.
FWIW as far as I know
Dict[Any, Any]
is not well supported in other TypedDict contexts. I decided to allowDict[Any, Any]
only because I found an example inmypy_primer
whereDict[Any, Any]
is used specifically in**
context. I think we can allowDict[Any, Any]
in other contexts, e.g. it can be a (non-proper) subtype of all non-total TypedDicts.