Skip to content

Commit cd84857

Browse files
committed
Make some minor fixes and improvements to the typedddicts_extra_items test.
1 parent 9d613b1 commit cd84857

File tree

7 files changed

+312
-294
lines changed

7 files changed

+312
-294
lines changed

conformance/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ pyright
55
mypy
66
pip
77
pyre-check; platform_system != "Windows"
8+
zuban

conformance/results/mypy/typeddicts_extra_items.toml

Lines changed: 91 additions & 89 deletions
Large diffs are not rendered by default.

conformance/results/pyre/typeddicts_extra_items.toml

Lines changed: 89 additions & 87 deletions
Large diffs are not rendered by default.
Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
conformant = "Pass"
2-
conformance_automated = "Pass"
1+
conformant = "Partial"
2+
notes = """
3+
Does not flag illegal use of `closed=False` when inheriting from a non-open TypedDict.
4+
"""
5+
conformance_automated = "Fail"
36
errors_diff = """
7+
Line 67: Expected 1 errors
8+
Line 73: Expected 1 errors
49
"""
510
output = """
611
typeddicts_extra_items.py:15:45 - error: Type "dict[str, str | int]" is not assignable to declared type "Movie"
@@ -10,56 +15,56 @@ typeddicts_extra_items.py:22:55 - error: Type "dict[str, str | int]" is not assi
1015
typeddicts_extra_items.py:39:54 - error: Type "dict[str, str | None]" is not assignable to declared type "InheritedMovie"
1116
  "None" is not assignable to "int" (reportAssignmentType)
1217
typeddicts_extra_items.py:49:35 - error: Expected "closed" parameter to have a value of True or False (reportGeneralTypeIssues)
13-
typeddicts_extra_items.py:67:7 - error: Base class "ClosedBase" is a TypedDict that limits the type of extra items to type "Never"
14-
  Cannot add item "age" (reportIncompatibleVariableOverride)
15-
typeddicts_extra_items.py:73:7 - error: Base class "ExtraItemsBase" is a TypedDict that limits the type of extra items to type "int"
16-
  Cannot add item "age" because it must be NotRequired (reportIncompatibleVariableOverride)
1718
typeddicts_extra_items.py:91:7 - error: Base class "MovieA" is a TypedDict that limits the type of extra items to type "Never"
1819
  Cannot add item "age" (reportIncompatibleVariableOverride)
1920
typeddicts_extra_items.py:94:7 - error: Base class "MovieB" is a TypedDict that limits the type of extra items to type "Never"
2021
  Cannot add item "age" (reportIncompatibleVariableOverride)
21-
typeddicts_extra_items.py:111:50 - error: "Required" is not allowed in this context (reportInvalidTypeForm)
22-
typeddicts_extra_items.py:114:57 - error: "NotRequired" is not allowed in this context (reportInvalidTypeForm)
23-
typeddicts_extra_items.py:125:9 - error: Could not delete item in TypedDict
22+
typeddicts_extra_items.py:109:7 - error: Base class "ExtraItemsBase" is a TypedDict that limits the type of extra items to type "int"
23+
  Cannot add item "extra_items" with type "Never" (reportIncompatibleVariableOverride)
24+
typeddicts_extra_items.py:114:50 - error: "Required" is not allowed in this context (reportInvalidTypeForm)
25+
typeddicts_extra_items.py:117:57 - error: "NotRequired" is not allowed in this context (reportInvalidTypeForm)
26+
typeddicts_extra_items.py:128:9 - error: Could not delete item in TypedDict
2427
  "name" is a required key and cannot be deleted (reportGeneralTypeIssues)
25-
typeddicts_extra_items.py:140:48 - error: No parameter named "year" (reportCallIssue)
26-
typeddicts_extra_items.py:171:7 - error: Base class "Parent" is a TypedDict that limits the type of extra items to type "int | None"
28+
typeddicts_extra_items.py:143:48 - error: No parameter named "year" (reportCallIssue)
29+
typeddicts_extra_items.py:174:7 - error: Base class "Parent" is a TypedDict that limits the type of extra items to type "int | None"
2730
  Cannot add item "extra_items" with type "int" (reportIncompatibleVariableOverride)
28-
typeddicts_extra_items.py:181:7 - error: Base class "MovieBase2" is a TypedDict that limits the type of extra items to type "int | None"
29-
  Cannot add item "year" because it must be NotRequired (reportIncompatibleVariableOverride)
3031
typeddicts_extra_items.py:184:7 - error: Base class "MovieBase2" is a TypedDict that limits the type of extra items to type "int | None"
32+
  Cannot add item "year" because it must be NotRequired (reportIncompatibleVariableOverride)
33+
typeddicts_extra_items.py:187:7 - error: Base class "MovieBase2" is a TypedDict that limits the type of extra items to type "int | None"
3134
  Cannot add item "year" with type "int" (reportIncompatibleVariableOverride)
32-
typeddicts_extra_items.py:206:22 - error: Type "MovieDetails" is not assignable to declared type "MovieBase2"
35+
typeddicts_extra_items.py:193:7 - error: Base class "MovieBase" is a TypedDict that limits the type of extra items to type "int | None"
36+
  Cannot add item "director" with type "str" (reportIncompatibleVariableOverride)
37+
typeddicts_extra_items.py:212:22 - error: Type "MovieDetails" is not assignable to declared type "MovieBase2"
3338
  Type of "year" is incompatible with type of "extra_items" in "MovieBase2"
3439
    Type "int" is not assignable to type "int | None"
3540
      "int" is not assignable to "None" (reportAssignmentType)
36-
typeddicts_extra_items.py:213:22 - error: Type "MovieWithYear2" is not assignable to declared type "MovieBase2"
41+
typeddicts_extra_items.py:219:22 - error: Type "MovieWithYear2" is not assignable to declared type "MovieBase2"
3742
  "year" is not required in "MovieBase2" (reportAssignmentType)
38-
typeddicts_extra_items.py:233:19 - error: Type "MovieDetails5" is not assignable to declared type "MovieSI"
43+
typeddicts_extra_items.py:239:19 - error: Type "MovieDetails5" is not assignable to declared type "MovieSI"
3944
  Type of "actors" is incompatible with type of "extra_items" in "MovieSI"
4045
    Type "list[str]" is not assignable to type "str | int"
4146
      "list[str]" is not assignable to "str"
4247
      "list[str]" is not assignable to "int" (reportAssignmentType)
43-
typeddicts_extra_items.py:247:13 - error: Type "MovieExtraStr" is not assignable to declared type "MovieExtraInt"
48+
typeddicts_extra_items.py:253:13 - error: Type "MovieExtraStr" is not assignable to declared type "MovieExtraInt"
4449
  Type of "extra_items" is incompatible with type of "extra_items" in "MovieExtraStr"
4550
    "str" is not assignable to "int" (reportAssignmentType)
46-
typeddicts_extra_items.py:248:13 - error: Type "MovieExtraInt" is not assignable to declared type "MovieExtraStr"
51+
typeddicts_extra_items.py:254:13 - error: Type "MovieExtraInt" is not assignable to declared type "MovieExtraStr"
4752
  Type of "extra_items" is incompatible with type of "extra_items" in "MovieExtraInt"
4853
    "int" is not assignable to "str" (reportAssignmentType)
49-
typeddicts_extra_items.py:259:14 - error: Type "MovieNotClosed" is not assignable to declared type "MovieExtraInt"
54+
typeddicts_extra_items.py:265:14 - error: Type "MovieNotClosed" is not assignable to declared type "MovieExtraInt"
5055
  Type of "extra_items" is incompatible with type of "extra_items" in "MovieNotClosed"
5156
    "object" is not assignable to "int" (reportAssignmentType)
52-
typeddicts_extra_items.py:269:1 - error: No overloads for "__init__" match the provided arguments
57+
typeddicts_extra_items.py:275:1 - error: No overloads for "__init__" match the provided arguments
5358
  Argument types: (Literal['No Country for Old Men'], Literal[2007]) (reportCallIssue)
54-
typeddicts_extra_items.py:276:52 - error: Argument of type "Literal['English']" cannot be assigned to parameter "language" of type "int" in function "__init__"
59+
typeddicts_extra_items.py:282:52 - error: Argument of type "Literal['English']" cannot be assigned to parameter "language" of type "int" in function "__init__"
5560
  "Literal['English']" is not assignable to "int" (reportArgumentType)
56-
typeddicts_extra_items.py:284:1 - error: No overloads for "__init__" match the provided arguments
61+
typeddicts_extra_items.py:290:1 - error: No overloads for "__init__" match the provided arguments
5762
  Argument types: (Literal['No Country for Old Men'], Literal[2007]) (reportCallIssue)
58-
typeddicts_extra_items.py:294:34 - error: Type "MovieExtraInt" is not assignable to declared type "Mapping[str, int]"
63+
typeddicts_extra_items.py:300:34 - error: Type "MovieExtraInt" is not assignable to declared type "Mapping[str, int]"
5964
  "Mapping[str, str | int]" is not assignable to "Mapping[str, int]"
6065
    Type parameter "_VT_co@Mapping" is covariant, but "str | int" is not a subtype of "int"
6166
      Type "str | int" is not assignable to type "int"
6267
        "str" is not assignable to "int" (reportAssignmentType)
63-
typeddicts_extra_items.py:343:25 - error: Type "dict[str, int]" is not assignable to declared type "IntDict"
68+
typeddicts_extra_items.py:349:25 - error: Type "dict[str, int]" is not assignable to declared type "IntDict"
6469
  "dict[str, int]" is not assignable to "IntDict" (reportAssignmentType)
6570
"""

conformance/results/results.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ <h3>Python Type System Conformance Test Results</h3>
817817
</tr>
818818
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;typeddicts_extra_items</th>
819819
<th class="column col2 not-conformant"><div class="hover-text">Unsupported<span class="tooltip-text" id="bottom"><p>Not supported.</p></span></div></th>
820-
<th class="column col2 conformant">Pass</th>
820+
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not flag illegal use of `closed=False` when inheriting from a non-open TypedDict.</p></span></div></th>
821821
<th class="column col2 not-conformant"><div class="hover-text">Unsupported<span class="tooltip-text" id="bottom"><p>Not supported.</p></span></div></th>
822822
<th class="column col2 not-conformant"><div class="hover-text">Unsupported<span class="tooltip-text" id="bottom"><p>Not supported.</p></span></div></th>
823823
</tr>

0 commit comments

Comments
 (0)