-
Notifications
You must be signed in to change notification settings - Fork 304
Add spec and tests for PEP 728 #2068
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 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
dc3c31e
spec, conformance: add PEP 728
JelleZijlstra e03f307
zuban too
JelleZijlstra 74cc55d
Apply suggestions from code review
JelleZijlstra 61a95d8
regen on 3.12
JelleZijlstra cd288d4
Update conformance/tests/typeddicts_extra_items.py
JelleZijlstra 2b7ce87
Merge branch 'main' into pep728
JelleZijlstra 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,143 @@ | ||
| conformant = "Fail" | ||
| notes = """ | ||
| Not supported. | ||
| """ | ||
| conformance_automated = "Fail" | ||
| errors_diff = """ | ||
| Line 181: Expected 1 errors | ||
| Line 184: Expected 1 errors | ||
| Line 206: Expected 1 errors | ||
| Line 213: Expected 1 errors | ||
| Line 233: Expected 1 errors | ||
| Line 247: Expected 1 errors | ||
| Line 248: Expected 1 errors | ||
| Line 259: Expected 1 errors | ||
| Lines 91, 92: Expected error (tag 'MovieC') | ||
| Lines 94, 95: Expected error (tag 'MovieD') | ||
| Line 11: Unexpected errors ['typeddicts_extra_items.py:11: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 14: Unexpected errors ['typeddicts_extra_items.py:14: error: Extra key "novel_adaptation" for TypedDict "Movie" [typeddict-unknown-key]'] | ||
| Line 19: Unexpected errors ['typeddicts_extra_items.py:19: error: Unexpected keyword argument "extra_items" for "TypedDict" [misc]'] | ||
| Line 21: Unexpected errors ['typeddicts_extra_items.py:21: error: Extra keys ("name", "novel_adaptation") for TypedDict "MovieFunctional" [typeddict-unknown-key]'] | ||
| Line 29: Unexpected errors ['typeddicts_extra_items.py:29: error: Expression is of type "Any", not "bool" [assert-type]', 'typeddicts_extra_items.py:29: error: TypedDict "Movie" has no key "novel_adaptation" [typeddict-item]'] | ||
| Line 33: Unexpected errors ['typeddicts_extra_items.py:33: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 40: Unexpected errors ['typeddicts_extra_items.py:40: error: Extra key "other_extra_key" for TypedDict "InheritedMovie" [typeddict-unknown-key]'] | ||
| Line 55: Unexpected errors ['typeddicts_extra_items.py:55: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 64: Unexpected errors ['typeddicts_extra_items.py:64: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 70: Unexpected errors ['typeddicts_extra_items.py:70: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 82: Unexpected errors ['typeddicts_extra_items.py:82: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 88: Unexpected errors ['typeddicts_extra_items.py:88: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 100: Unexpected errors ['typeddicts_extra_items.py:100: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 103: Unexpected errors ['typeddicts_extra_items.py:103: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 106: Unexpected errors ['typeddicts_extra_items.py:106: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 121: Unexpected errors ['typeddicts_extra_items.py:121: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 126: Unexpected errors ['typeddicts_extra_items.py:126: error: TypedDict "MovieEI" has no key "year" [typeddict-item]'] | ||
| Line 134: Unexpected errors ['typeddicts_extra_items.py:134: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 141: Unexpected errors ['typeddicts_extra_items.py:141: error: Unexpected keyword argument "year" for "unpack_extra" [call-arg]'] | ||
| Line 146: Unexpected errors ['typeddicts_extra_items.py:146: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 149: Unexpected errors ['typeddicts_extra_items.py:149: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 152: Unexpected errors ['typeddicts_extra_items.py:152: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 162: Unexpected errors ['typeddicts_extra_items.py:162: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 168: Unexpected errors ['typeddicts_extra_items.py:168: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 178: Unexpected errors ['typeddicts_extra_items.py:178: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 201: Unexpected errors ['typeddicts_extra_items.py:201: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 208: Unexpected errors ['typeddicts_extra_items.py:208: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 219: Unexpected errors ['typeddicts_extra_items.py:219: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 222: Unexpected errors ['typeddicts_extra_items.py:222: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 226: Unexpected errors ['typeddicts_extra_items.py:226: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 239: Unexpected errors ['typeddicts_extra_items.py:239: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 242: Unexpected errors ['typeddicts_extra_items.py:242: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 245: Unexpected errors ['typeddicts_extra_items.py:245: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] | ||
| Line 246: Unexpected errors ['typeddicts_extra_items.py:246: error: Extra key "description" for TypedDict "MovieExtraStr" [typeddict-unknown-key]'] | ||
| Line 257: Unexpected errors ['typeddicts_extra_items.py:257: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] | ||
| Line 271: Unexpected errors ['typeddicts_extra_items.py:271: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 275: Unexpected errors ['typeddicts_extra_items.py:275: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key]'] | ||
| Line 280: Unexpected errors ['typeddicts_extra_items.py:280: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 290: Unexpected errors ['typeddicts_extra_items.py:290: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key]'] | ||
| Line 291: Unexpected errors ['typeddicts_extra_items.py:291: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") [assignment]'] | ||
| Line 293: Unexpected errors ['typeddicts_extra_items.py:293: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] | ||
| Line 295: Unexpected errors ['typeddicts_extra_items.py:295: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") [assignment]'] | ||
| Line 301: Unexpected errors ['typeddicts_extra_items.py:301: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" [assert-type]'] | ||
| Line 302: Unexpected errors ['typeddicts_extra_items.py:302: error: Expression is of type "list[object]", not "list[int | str]" [assert-type]'] | ||
| Line 310: Unexpected errors ['typeddicts_extra_items.py:310: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] | ||
| Line 317: Unexpected errors ['typeddicts_extra_items.py:317: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") [assignment]'] | ||
| Line 320: Unexpected errors ['typeddicts_extra_items.py:320: error: Extra key "bar" for TypedDict "IntDictWithNum" [typeddict-unknown-key]'] | ||
| Line 321: Unexpected errors ['typeddicts_extra_items.py:321: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") [assignment]'] | ||
| Line 328: Unexpected errors ['typeddicts_extra_items.py:328: error: "IntDictWithNum" has no attribute "clear" [attr-defined]'] | ||
| Line 330: Unexpected errors ['typeddicts_extra_items.py:330: error: Expression is of type "Any", not "tuple[str, int]" [assert-type]', 'typeddicts_extra_items.py:330: error: "IntDictWithNum" has no attribute "popitem" [attr-defined]'] | ||
| Line 333: Unexpected errors ['typeddicts_extra_items.py:333: error: TypedDict key must be a string literal; expected one of ("num") [literal-required]'] | ||
| Line 334: Unexpected errors ['typeddicts_extra_items.py:334: error: Expected TypedDict key to be string literal [misc]'] | ||
| """ | ||
| output = """ | ||
| typeddicts_extra_items.py:11: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:14: error: Extra key "novel_adaptation" for TypedDict "Movie" [typeddict-unknown-key] | ||
| typeddicts_extra_items.py:15: error: Extra key "year" for TypedDict "Movie" [typeddict-unknown-key] | ||
| typeddicts_extra_items.py:19: error: Unexpected keyword argument "extra_items" for "TypedDict" [misc] | ||
| typeddicts_extra_items.py:21: error: Extra keys ("name", "novel_adaptation") for TypedDict "MovieFunctional" [typeddict-unknown-key] | ||
| typeddicts_extra_items.py:22: error: Extra keys ("name", "year") for TypedDict "MovieFunctional" [typeddict-unknown-key] | ||
| typeddicts_extra_items.py:29: error: Expression is of type "Any", not "bool" [assert-type] | ||
| typeddicts_extra_items.py:29: error: TypedDict "Movie" has no key "novel_adaptation" [typeddict-item] | ||
| typeddicts_extra_items.py:33: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:39: error: Incompatible types (expression has type "None", TypedDict item "year" has type "int") [typeddict-item] | ||
| typeddicts_extra_items.py:40: error: Extra key "other_extra_key" for TypedDict "InheritedMovie" [typeddict-unknown-key] | ||
| typeddicts_extra_items.py:49: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:55: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:64: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:67: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:70: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:73: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:82: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:88: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:100: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:103: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:106: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:111: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:114: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:121: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:125: error: Key "name" of TypedDict "MovieEI" cannot be deleted [misc] | ||
| typeddicts_extra_items.py:126: error: TypedDict "MovieEI" has no key "year" [typeddict-item] | ||
| typeddicts_extra_items.py:134: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:137: note: "unpack_no_extra" defined here | ||
| typeddicts_extra_items.py:138: note: "unpack_extra" defined here | ||
| typeddicts_extra_items.py:140: error: Unexpected keyword argument "year" for "unpack_no_extra" [call-arg] | ||
| typeddicts_extra_items.py:141: error: Unexpected keyword argument "year" for "unpack_extra" [call-arg] | ||
| typeddicts_extra_items.py:146: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:149: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:152: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:162: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:168: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:171: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:178: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:201: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:208: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:219: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:222: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:226: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:239: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:242: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:245: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] | ||
| typeddicts_extra_items.py:246: error: Extra key "description" for TypedDict "MovieExtraStr" [typeddict-unknown-key] | ||
| typeddicts_extra_items.py:257: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] | ||
| typeddicts_extra_items.py:269: error: Extra key "year" for TypedDict "NonClosedMovie" [typeddict-unknown-key] | ||
| typeddicts_extra_items.py:271: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:275: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key] | ||
| typeddicts_extra_items.py:276: error: Extra key "language" for TypedDict "ExtraMovie" [typeddict-unknown-key] | ||
| typeddicts_extra_items.py:280: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ClosedMovie" [typeddict-unknown-key] | ||
| typeddicts_extra_items.py:290: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key] | ||
| typeddicts_extra_items.py:291: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") [assignment] | ||
| typeddicts_extra_items.py:293: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] | ||
| typeddicts_extra_items.py:294: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int]") [assignment] | ||
| typeddicts_extra_items.py:295: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") [assignment] | ||
| typeddicts_extra_items.py:301: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" [assert-type] | ||
| typeddicts_extra_items.py:302: error: Expression is of type "list[object]", not "list[int | str]" [assert-type] | ||
| typeddicts_extra_items.py:310: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] | ||
| typeddicts_extra_items.py:317: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") [assignment] | ||
| typeddicts_extra_items.py:320: error: Extra key "bar" for TypedDict "IntDictWithNum" [typeddict-unknown-key] | ||
| typeddicts_extra_items.py:321: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") [assignment] | ||
| typeddicts_extra_items.py:328: error: "IntDictWithNum" has no attribute "clear" [attr-defined] | ||
| typeddicts_extra_items.py:330: error: Expression is of type "Any", not "tuple[str, int]" [assert-type] | ||
| typeddicts_extra_items.py:330: error: "IntDictWithNum" has no attribute "popitem" [attr-defined] | ||
| typeddicts_extra_items.py:333: error: TypedDict key must be a string literal; expected one of ("num") [literal-required] | ||
| typeddicts_extra_items.py:334: error: Expected TypedDict key to be string literal [misc] | ||
| typeddicts_extra_items.py:343: error: Incompatible types in assignment (expression has type "dict[str, int]", variable has type "IntDict") [assignment] | ||
| """ | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.