Skip to content

Commit 59e9299

Browse files
committed
Add BookBase base class.
1 parent cd84857 commit 59e9299

File tree

5 files changed

+214
-205
lines changed

5 files changed

+214
-205
lines changed

conformance/results/mypy/typeddicts_extra_items.toml

Lines changed: 65 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ Not supported.
44
"""
55
conformance_automated = "Fail"
66
errors_diff = """
7-
Line 212: Expected 1 errors
8-
Line 219: Expected 1 errors
9-
Line 239: Expected 1 errors
10-
Line 253: Expected 1 errors
11-
Line 254: Expected 1 errors
12-
Line 265: Expected 1 errors
7+
Line 215: Expected 1 errors
8+
Line 222: Expected 1 errors
9+
Line 242: Expected 1 errors
10+
Line 256: Expected 1 errors
11+
Line 257: Expected 1 errors
12+
Line 268: Expected 1 errors
1313
Lines 91, 92: Expected error (tag 'MovieC')
1414
Lines 94, 95: Expected error (tag 'MovieD')
1515
Lines 184, 185: Expected error (tag 'MovieRequiredYear')
1616
Lines 187, 188: Expected error (tag 'MovieNotRequiredYear')
17-
Lines 193, 194: Expected error (tag 'MovieWithDirector')
17+
Lines 196, 197: Expected error (tag 'BookWithPublisher')
1818
Line 11: Unexpected errors ['typeddicts_extra_items.py:11: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
1919
Line 14: Unexpected errors ['typeddicts_extra_items.py:14: error: Extra key "novel_adaptation" for TypedDict "Movie" [typeddict-unknown-key]']
2020
Line 19: Unexpected errors ['typeddicts_extra_items.py:19: error: Unexpected keyword argument "extra_items" for "TypedDict" [misc]']
@@ -40,33 +40,34 @@ Line 155: Unexpected errors ['typeddicts_extra_items.py:155: error: Unexpected k
4040
Line 165: Unexpected errors ['typeddicts_extra_items.py:165: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
4141
Line 171: Unexpected errors ['typeddicts_extra_items.py:171: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
4242
Line 181: Unexpected errors ['typeddicts_extra_items.py:181: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
43-
Line 207: Unexpected errors ['typeddicts_extra_items.py:207: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
44-
Line 214: Unexpected errors ['typeddicts_extra_items.py:214: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
45-
Line 225: Unexpected errors ['typeddicts_extra_items.py:225: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
43+
Line 193: Unexpected errors ['typeddicts_extra_items.py:193: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
44+
Line 210: Unexpected errors ['typeddicts_extra_items.py:210: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
45+
Line 217: Unexpected errors ['typeddicts_extra_items.py:217: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
4646
Line 228: Unexpected errors ['typeddicts_extra_items.py:228: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
47-
Line 232: Unexpected errors ['typeddicts_extra_items.py:232: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
48-
Line 245: Unexpected errors ['typeddicts_extra_items.py:245: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
47+
Line 231: Unexpected errors ['typeddicts_extra_items.py:231: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
48+
Line 235: Unexpected errors ['typeddicts_extra_items.py:235: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
4949
Line 248: Unexpected errors ['typeddicts_extra_items.py:248: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
50-
Line 251: Unexpected errors ['typeddicts_extra_items.py:251: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]']
51-
Line 252: Unexpected errors ['typeddicts_extra_items.py:252: error: Extra key "description" for TypedDict "MovieExtraStr" [typeddict-unknown-key]']
52-
Line 263: Unexpected errors ['typeddicts_extra_items.py:263: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]']
53-
Line 277: Unexpected errors ['typeddicts_extra_items.py:277: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
54-
Line 281: Unexpected errors ['typeddicts_extra_items.py:281: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key]']
55-
Line 286: Unexpected errors ['typeddicts_extra_items.py:286: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]']
56-
Line 296: Unexpected errors ['typeddicts_extra_items.py:296: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key]']
57-
Line 297: Unexpected errors ['typeddicts_extra_items.py:297: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") [assignment]']
58-
Line 299: Unexpected errors ['typeddicts_extra_items.py:299: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]']
59-
Line 301: Unexpected errors ['typeddicts_extra_items.py:301: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") [assignment]']
60-
Line 307: Unexpected errors ['typeddicts_extra_items.py:307: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" [assert-type]']
61-
Line 308: Unexpected errors ['typeddicts_extra_items.py:308: error: Expression is of type "list[object]", not "list[int | str]" [assert-type]']
62-
Line 316: Unexpected errors ['typeddicts_extra_items.py:316: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
63-
Line 323: Unexpected errors ['typeddicts_extra_items.py:323: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") [assignment]']
64-
Line 326: Unexpected errors ['typeddicts_extra_items.py:326: error: Extra key "bar" for TypedDict "IntDictWithNum" [typeddict-unknown-key]']
65-
Line 327: Unexpected errors ['typeddicts_extra_items.py:327: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") [assignment]']
66-
Line 334: Unexpected errors ['typeddicts_extra_items.py:334: error: "IntDictWithNum" has no attribute "clear" [attr-defined]']
67-
Line 336: Unexpected errors ['typeddicts_extra_items.py:336: error: Expression is of type "Any", not "tuple[str, int]" [assert-type]', 'typeddicts_extra_items.py:336: error: "IntDictWithNum" has no attribute "popitem" [attr-defined]']
68-
Line 339: Unexpected errors ['typeddicts_extra_items.py:339: error: TypedDict key must be a string literal; expected one of ("num") [literal-required]']
69-
Line 340: Unexpected errors ['typeddicts_extra_items.py:340: error: Expected TypedDict key to be string literal [misc]']
50+
Line 251: Unexpected errors ['typeddicts_extra_items.py:251: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
51+
Line 254: Unexpected errors ['typeddicts_extra_items.py:254: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]']
52+
Line 255: Unexpected errors ['typeddicts_extra_items.py:255: error: Extra key "description" for TypedDict "MovieExtraStr" [typeddict-unknown-key]']
53+
Line 266: Unexpected errors ['typeddicts_extra_items.py:266: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]']
54+
Line 280: Unexpected errors ['typeddicts_extra_items.py:280: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
55+
Line 284: Unexpected errors ['typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key]']
56+
Line 289: Unexpected errors ['typeddicts_extra_items.py:289: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]']
57+
Line 299: Unexpected errors ['typeddicts_extra_items.py:299: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key]']
58+
Line 300: Unexpected errors ['typeddicts_extra_items.py:300: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") [assignment]']
59+
Line 302: Unexpected errors ['typeddicts_extra_items.py:302: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]']
60+
Line 304: Unexpected errors ['typeddicts_extra_items.py:304: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") [assignment]']
61+
Line 310: Unexpected errors ['typeddicts_extra_items.py:310: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" [assert-type]']
62+
Line 311: Unexpected errors ['typeddicts_extra_items.py:311: error: Expression is of type "list[object]", not "list[int | str]" [assert-type]']
63+
Line 319: Unexpected errors ['typeddicts_extra_items.py:319: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
64+
Line 326: Unexpected errors ['typeddicts_extra_items.py:326: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") [assignment]']
65+
Line 329: Unexpected errors ['typeddicts_extra_items.py:329: error: Extra key "bar" for TypedDict "IntDictWithNum" [typeddict-unknown-key]']
66+
Line 330: Unexpected errors ['typeddicts_extra_items.py:330: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") [assignment]']
67+
Line 337: Unexpected errors ['typeddicts_extra_items.py:337: error: "IntDictWithNum" has no attribute "clear" [attr-defined]']
68+
Line 339: Unexpected errors ['typeddicts_extra_items.py:339: error: Expression is of type "Any", not "tuple[str, int]" [assert-type]', 'typeddicts_extra_items.py:339: error: "IntDictWithNum" has no attribute "popitem" [attr-defined]']
69+
Line 342: Unexpected errors ['typeddicts_extra_items.py:342: error: TypedDict key must be a string literal; expected one of ("num") [literal-required]']
70+
Line 343: Unexpected errors ['typeddicts_extra_items.py:343: error: Expected TypedDict key to be string literal [misc]']
7071
"""
7172
output = """
7273
typeddicts_extra_items.py:11: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
@@ -109,37 +110,38 @@ typeddicts_extra_items.py:165: error: Unexpected keyword argument "extra_items"
109110
typeddicts_extra_items.py:171: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
110111
typeddicts_extra_items.py:174: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
111112
typeddicts_extra_items.py:181: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
112-
typeddicts_extra_items.py:207: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
113-
typeddicts_extra_items.py:214: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
114-
typeddicts_extra_items.py:225: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
113+
typeddicts_extra_items.py:193: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
114+
typeddicts_extra_items.py:210: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
115+
typeddicts_extra_items.py:217: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
115116
typeddicts_extra_items.py:228: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
116-
typeddicts_extra_items.py:232: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
117-
typeddicts_extra_items.py:245: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
117+
typeddicts_extra_items.py:231: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
118+
typeddicts_extra_items.py:235: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
118119
typeddicts_extra_items.py:248: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
119-
typeddicts_extra_items.py:251: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]
120-
typeddicts_extra_items.py:252: error: Extra key "description" for TypedDict "MovieExtraStr" [typeddict-unknown-key]
121-
typeddicts_extra_items.py:263: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]
122-
typeddicts_extra_items.py:275: error: Extra key "year" for TypedDict "NonClosedMovie" [typeddict-unknown-key]
123-
typeddicts_extra_items.py:277: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
124-
typeddicts_extra_items.py:281: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key]
125-
typeddicts_extra_items.py:282: error: Extra key "language" for TypedDict "ExtraMovie" [typeddict-unknown-key]
126-
typeddicts_extra_items.py:286: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]
127-
typeddicts_extra_items.py:290: error: Extra key "year" for TypedDict "ClosedMovie" [typeddict-unknown-key]
128-
typeddicts_extra_items.py:296: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key]
129-
typeddicts_extra_items.py:297: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") [assignment]
130-
typeddicts_extra_items.py:299: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]
131-
typeddicts_extra_items.py:300: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int]") [assignment]
132-
typeddicts_extra_items.py:301: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") [assignment]
133-
typeddicts_extra_items.py:307: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" [assert-type]
134-
typeddicts_extra_items.py:308: error: Expression is of type "list[object]", not "list[int | str]" [assert-type]
135-
typeddicts_extra_items.py:316: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
136-
typeddicts_extra_items.py:323: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") [assignment]
137-
typeddicts_extra_items.py:326: error: Extra key "bar" for TypedDict "IntDictWithNum" [typeddict-unknown-key]
138-
typeddicts_extra_items.py:327: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") [assignment]
139-
typeddicts_extra_items.py:334: error: "IntDictWithNum" has no attribute "clear" [attr-defined]
140-
typeddicts_extra_items.py:336: error: Expression is of type "Any", not "tuple[str, int]" [assert-type]
141-
typeddicts_extra_items.py:336: error: "IntDictWithNum" has no attribute "popitem" [attr-defined]
142-
typeddicts_extra_items.py:339: error: TypedDict key must be a string literal; expected one of ("num") [literal-required]
143-
typeddicts_extra_items.py:340: error: Expected TypedDict key to be string literal [misc]
144-
typeddicts_extra_items.py:349: error: Incompatible types in assignment (expression has type "dict[str, int]", variable has type "IntDict") [assignment]
120+
typeddicts_extra_items.py:251: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
121+
typeddicts_extra_items.py:254: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]
122+
typeddicts_extra_items.py:255: error: Extra key "description" for TypedDict "MovieExtraStr" [typeddict-unknown-key]
123+
typeddicts_extra_items.py:266: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]
124+
typeddicts_extra_items.py:278: error: Extra key "year" for TypedDict "NonClosedMovie" [typeddict-unknown-key]
125+
typeddicts_extra_items.py:280: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
126+
typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key]
127+
typeddicts_extra_items.py:285: error: Extra key "language" for TypedDict "ExtraMovie" [typeddict-unknown-key]
128+
typeddicts_extra_items.py:289: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]
129+
typeddicts_extra_items.py:293: error: Extra key "year" for TypedDict "ClosedMovie" [typeddict-unknown-key]
130+
typeddicts_extra_items.py:299: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key]
131+
typeddicts_extra_items.py:300: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") [assignment]
132+
typeddicts_extra_items.py:302: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]
133+
typeddicts_extra_items.py:303: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int]") [assignment]
134+
typeddicts_extra_items.py:304: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") [assignment]
135+
typeddicts_extra_items.py:310: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" [assert-type]
136+
typeddicts_extra_items.py:311: error: Expression is of type "list[object]", not "list[int | str]" [assert-type]
137+
typeddicts_extra_items.py:319: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
138+
typeddicts_extra_items.py:326: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") [assignment]
139+
typeddicts_extra_items.py:329: error: Extra key "bar" for TypedDict "IntDictWithNum" [typeddict-unknown-key]
140+
typeddicts_extra_items.py:330: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") [assignment]
141+
typeddicts_extra_items.py:337: error: "IntDictWithNum" has no attribute "clear" [attr-defined]
142+
typeddicts_extra_items.py:339: error: Expression is of type "Any", not "tuple[str, int]" [assert-type]
143+
typeddicts_extra_items.py:339: error: "IntDictWithNum" has no attribute "popitem" [attr-defined]
144+
typeddicts_extra_items.py:342: error: TypedDict key must be a string literal; expected one of ("num") [literal-required]
145+
typeddicts_extra_items.py:343: error: Expected TypedDict key to be string literal [misc]
146+
typeddicts_extra_items.py:352: error: Incompatible types in assignment (expression has type "dict[str, int]", variable has type "IntDict") [assignment]
145147
"""

0 commit comments

Comments
 (0)