-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Change reveal_type() representation of TypedDicts #3598
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
Changes from all commits
2dabfd8
eaf988a
b8a8dab
01b242a
880df24
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1018,12 +1018,12 @@ class C: | |
self.c = A | ||
[builtins fixtures/dict.pyi] | ||
[out1] | ||
main:2: error: Revealed type is 'TypedDict(x=builtins.int, _fallback=typing.Mapping[builtins.str, builtins.int])' | ||
main:3: error: Revealed type is 'TypedDict(x=builtins.int, _fallback=ntcrash.C.A@4)' | ||
main:2: error: Revealed type is 'TypedDict('ntcrash.C.A@4', {'x': builtins.int})' | ||
main:3: error: Revealed type is 'TypedDict('ntcrash.C.A@4', {'x': builtins.int})' | ||
main:4: error: Revealed type is 'def () -> ntcrash.C.A@4' | ||
[out2] | ||
main:2: error: Revealed type is 'TypedDict(x=builtins.int, _fallback=typing.Mapping[builtins.str, builtins.int])' | ||
main:3: error: Revealed type is 'TypedDict(x=builtins.int, _fallback=ntcrash.C.A@4)' | ||
main:2: error: Revealed type is 'TypedDict('ntcrash.C.A@4', {'x': builtins.int})' | ||
main:3: error: Revealed type is 'TypedDict('ntcrash.C.A@4', {'x': builtins.int})' | ||
main:4: error: Revealed type is 'def () -> ntcrash.C.A@4' | ||
|
||
[case testSerializeNonTotalTypedDict] | ||
|
@@ -1035,9 +1035,9 @@ D = TypedDict('D', {'x': int, 'y': str}, total=False) | |
d: D | ||
[builtins fixtures/dict.pyi] | ||
[out1] | ||
main:2: error: Revealed type is 'TypedDict(x=builtins.int, y=builtins.str, _fallback=m.D, _total=False)' | ||
main:2: error: Revealed type is 'TypedDict('m.D', {'x'?: builtins.int, 'y'?: builtins.str})' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think while the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A good point. I'll update the docs tomorrow to mention |
||
[out2] | ||
main:2: error: Revealed type is 'TypedDict(x=builtins.int, y=builtins.str, _fallback=m.D, _total=False)' | ||
main:2: error: Revealed type is 'TypedDict('m.D', {'x'?: builtins.int, 'y'?: builtins.str})' | ||
|
||
-- | ||
-- Modules | ||
|
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.
Is there a reason you do not create a new
TypedDictType
anymore?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.
Oh, is that in order to preserve the original TypedDict name?
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.
Yes. Also, the deleted code no longer serves its original purpose because of changes to
TypedDict
type inference.