From cd84857f37dacb162a830247ee2ff4eafe6cda67 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Tue, 19 Aug 2025 18:51:43 -0700 Subject: [PATCH 1/2] Make some minor fixes and improvements to the typedddicts_extra_items test. --- conformance/requirements.txt | 1 + .../results/mypy/typeddicts_extra_items.toml | 180 +++++++++--------- .../results/pyre/typeddicts_extra_items.toml | 176 ++++++++--------- .../pyright/typeddicts_extra_items.toml | 53 +++--- conformance/results/results.html | 2 +- .../results/zuban/typeddicts_extra_items.toml | 176 ++++++++--------- conformance/tests/typeddicts_extra_items.py | 18 +- 7 files changed, 312 insertions(+), 294 deletions(-) diff --git a/conformance/requirements.txt b/conformance/requirements.txt index 973d0bf5..0e2f33c6 100644 --- a/conformance/requirements.txt +++ b/conformance/requirements.txt @@ -5,3 +5,4 @@ pyright mypy pip pyre-check; platform_system != "Windows" +zuban diff --git a/conformance/results/mypy/typeddicts_extra_items.toml b/conformance/results/mypy/typeddicts_extra_items.toml index 9f1bde56..bff0c8b9 100644 --- a/conformance/results/mypy/typeddicts_extra_items.toml +++ b/conformance/results/mypy/typeddicts_extra_items.toml @@ -4,16 +4,17 @@ 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 +Line 212: Expected 1 errors +Line 219: Expected 1 errors +Line 239: Expected 1 errors +Line 253: Expected 1 errors +Line 254: Expected 1 errors +Line 265: Expected 1 errors Lines 91, 92: Expected error (tag 'MovieC') Lines 94, 95: Expected error (tag 'MovieD') +Lines 184, 185: Expected error (tag 'MovieRequiredYear') +Lines 187, 188: Expected error (tag 'MovieNotRequiredYear') +Lines 193, 194: Expected error (tag 'MovieWithDirector') 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]'] @@ -29,43 +30,43 @@ Line 88: Unexpected errors ['typeddicts_extra_items.py:88: error: Unexpected key 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 124: Unexpected errors ['typeddicts_extra_items.py:124: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 129: Unexpected errors ['typeddicts_extra_items.py:129: error: TypedDict "MovieEI" has no key "year" [typeddict-item]'] +Line 137: Unexpected errors ['typeddicts_extra_items.py:137: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 144: Unexpected errors ['typeddicts_extra_items.py:144: error: Unexpected keyword argument "year" for "unpack_extra" [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]'] +Line 155: Unexpected errors ['typeddicts_extra_items.py:155: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 165: Unexpected errors ['typeddicts_extra_items.py:165: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 171: Unexpected errors ['typeddicts_extra_items.py:171: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 181: Unexpected errors ['typeddicts_extra_items.py:181: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 207: Unexpected errors ['typeddicts_extra_items.py:207: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 214: Unexpected errors ['typeddicts_extra_items.py:214: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 225: Unexpected errors ['typeddicts_extra_items.py:225: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 228: Unexpected errors ['typeddicts_extra_items.py:228: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 232: Unexpected errors ['typeddicts_extra_items.py:232: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 245: Unexpected errors ['typeddicts_extra_items.py:245: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 248: Unexpected errors ['typeddicts_extra_items.py:248: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 251: Unexpected errors ['typeddicts_extra_items.py:251: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] +Line 252: Unexpected errors ['typeddicts_extra_items.py:252: error: Extra key "description" for TypedDict "MovieExtraStr" [typeddict-unknown-key]'] +Line 263: Unexpected errors ['typeddicts_extra_items.py:263: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] +Line 277: Unexpected errors ['typeddicts_extra_items.py:277: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 281: Unexpected errors ['typeddicts_extra_items.py:281: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key]'] +Line 286: Unexpected errors ['typeddicts_extra_items.py:286: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 296: Unexpected errors ['typeddicts_extra_items.py:296: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key]'] +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]'] +Line 299: Unexpected errors ['typeddicts_extra_items.py:299: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] +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]'] +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]'] +Line 308: Unexpected errors ['typeddicts_extra_items.py:308: error: Expression is of type "list[object]", not "list[int | str]" [assert-type]'] +Line 316: Unexpected errors ['typeddicts_extra_items.py:316: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +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]'] +Line 326: Unexpected errors ['typeddicts_extra_items.py:326: error: Extra key "bar" for TypedDict "IntDictWithNum" [typeddict-unknown-key]'] +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]'] +Line 334: Unexpected errors ['typeddicts_extra_items.py:334: error: "IntDictWithNum" has no attribute "clear" [attr-defined]'] +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]'] +Line 339: Unexpected errors ['typeddicts_extra_items.py:339: error: TypedDict key must be a string literal; expected one of ("num") [literal-required]'] +Line 340: Unexpected errors ['typeddicts_extra_items.py:340: 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] @@ -90,54 +91,55 @@ typeddicts_extra_items.py:88: error: Unexpected keyword argument "closed" for "_ 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:109: error: Unexpected keyword argument "closed" 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:117: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:124: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:128: error: Key "name" of TypedDict "MovieEI" cannot be deleted [misc] +typeddicts_extra_items.py:129: error: TypedDict "MovieEI" has no key "year" [typeddict-item] +typeddicts_extra_items.py:137: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:140: note: "unpack_no_extra" defined here +typeddicts_extra_items.py:141: note: "unpack_extra" defined here +typeddicts_extra_items.py:143: error: Unexpected keyword argument "year" for "unpack_no_extra" [call-arg] +typeddicts_extra_items.py:144: error: Unexpected keyword argument "year" for "unpack_extra" [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:155: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:165: 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] +typeddicts_extra_items.py:174: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:181: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:207: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:214: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:225: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:228: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:232: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:245: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:248: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:251: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] +typeddicts_extra_items.py:252: error: Extra key "description" for TypedDict "MovieExtraStr" [typeddict-unknown-key] +typeddicts_extra_items.py:263: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] +typeddicts_extra_items.py:275: error: Extra key "year" for TypedDict "NonClosedMovie" [typeddict-unknown-key] +typeddicts_extra_items.py:277: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:281: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key] +typeddicts_extra_items.py:282: error: Extra key "language" for TypedDict "ExtraMovie" [typeddict-unknown-key] +typeddicts_extra_items.py:286: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:290: error: Extra key "year" for TypedDict "ClosedMovie" [typeddict-unknown-key] +typeddicts_extra_items.py:296: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key] +typeddicts_extra_items.py:297: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") [assignment] +typeddicts_extra_items.py:299: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] +typeddicts_extra_items.py:300: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int]") [assignment] +typeddicts_extra_items.py:301: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") [assignment] +typeddicts_extra_items.py:307: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" [assert-type] +typeddicts_extra_items.py:308: error: Expression is of type "list[object]", not "list[int | str]" [assert-type] +typeddicts_extra_items.py:316: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:323: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") [assignment] +typeddicts_extra_items.py:326: error: Extra key "bar" for TypedDict "IntDictWithNum" [typeddict-unknown-key] +typeddicts_extra_items.py:327: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") [assignment] +typeddicts_extra_items.py:334: error: "IntDictWithNum" has no attribute "clear" [attr-defined] +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] +typeddicts_extra_items.py:339: error: TypedDict key must be a string literal; expected one of ("num") [literal-required] +typeddicts_extra_items.py:340: error: Expected TypedDict key to be string literal [misc] +typeddicts_extra_items.py:349: error: Incompatible types in assignment (expression has type "dict[str, int]", variable has type "IntDict") [assignment] """ diff --git a/conformance/results/pyre/typeddicts_extra_items.toml b/conformance/results/pyre/typeddicts_extra_items.toml index aa91c7f4..a2a8a322 100644 --- a/conformance/results/pyre/typeddicts_extra_items.toml +++ b/conformance/results/pyre/typeddicts_extra_items.toml @@ -4,16 +4,17 @@ 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 +Line 212: Expected 1 errors +Line 219: Expected 1 errors +Line 239: Expected 1 errors +Line 253: Expected 1 errors +Line 254: Expected 1 errors +Line 265: Expected 1 errors Lines 91, 92: Expected error (tag 'MovieC') Lines 94, 95: Expected error (tag 'MovieD') +Lines 184, 185: Expected error (tag 'MovieRequiredYear') +Lines 187, 188: Expected error (tag 'MovieNotRequiredYear') +Lines 193, 194: Expected error (tag 'MovieWithDirector') Line 11: Unexpected errors ['typeddicts_extra_items.py:11:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] Line 14: Unexpected errors ['typeddicts_extra_items.py:14:11 TypedDict initialization error [55]: TypedDict `Movie` has no field `novel_adaptation`.'] Line 21: Unexpected errors ['typeddicts_extra_items.py:21:21 TypedDict initialization error [55]: TypedDict `MovieFunctional` has no field `novel_adaptation`.'] @@ -28,43 +29,43 @@ Line 88: Unexpected errors ['typeddicts_extra_items.py:88:0 Unexpected keyword [ Line 100: Unexpected errors ['typeddicts_extra_items.py:100:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] Line 103: Unexpected errors ['typeddicts_extra_items.py:103:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`.'] Line 106: Unexpected errors ['typeddicts_extra_items.py:106:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 121: Unexpected errors ['typeddicts_extra_items.py:121:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 126: Unexpected errors ['typeddicts_extra_items.py:126:14 TypedDict accessed with a missing key [27]: TypedDict `MovieEI` has no key `year`.'] -Line 134: Unexpected errors ['typeddicts_extra_items.py:134:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 141: Unexpected errors ['typeddicts_extra_items.py:141:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `unpack_extra`.'] -Line 146: Unexpected errors ['typeddicts_extra_items.py:146:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 124: Unexpected errors ['typeddicts_extra_items.py:124:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 129: Unexpected errors ['typeddicts_extra_items.py:129:14 TypedDict accessed with a missing key [27]: TypedDict `MovieEI` has no key `year`.'] +Line 137: Unexpected errors ['typeddicts_extra_items.py:137:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 144: Unexpected errors ['typeddicts_extra_items.py:144:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `unpack_extra`.'] Line 149: Unexpected errors ['typeddicts_extra_items.py:149:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] Line 152: Unexpected errors ['typeddicts_extra_items.py:152:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 162: Unexpected errors ['typeddicts_extra_items.py:162:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 168: Unexpected errors ['typeddicts_extra_items.py:168:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 178: Unexpected errors ['typeddicts_extra_items.py:178:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 201: Unexpected errors ['typeddicts_extra_items.py:201:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 208: Unexpected errors ['typeddicts_extra_items.py:208:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 219: Unexpected errors ['typeddicts_extra_items.py:219:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 222: Unexpected errors ['typeddicts_extra_items.py:222:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 226: Unexpected errors ['typeddicts_extra_items.py:226:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 239: Unexpected errors ['typeddicts_extra_items.py:239:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 242: Unexpected errors ['typeddicts_extra_items.py:242:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 245: Unexpected errors ['typeddicts_extra_items.py:245:27 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] -Line 246: Unexpected errors ['typeddicts_extra_items.py:246:27 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `description`.'] -Line 257: Unexpected errors ['typeddicts_extra_items.py:257:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] -Line 271: Unexpected errors ['typeddicts_extra_items.py:271:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 275: Unexpected errors ['typeddicts_extra_items.py:275:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ExtraMovie.__init__`.'] -Line 280: Unexpected errors ['typeddicts_extra_items.py:280:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`.'] -Line 290: Unexpected errors ['typeddicts_extra_items.py:290:28 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `summary`.'] -Line 291: Unexpected errors ['typeddicts_extra_items.py:291:0 Incompatible variable type [9]: str_mapping is declared to have type `Mapping[str, str]` but is used as type `MovieExtraStr`.'] -Line 293: Unexpected errors ['typeddicts_extra_items.py:293:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] -Line 295: Unexpected errors ['typeddicts_extra_items.py:295:0 Incompatible variable type [9]: int_str_mapping is declared to have type `Mapping[str, Union[int, str]]` but is used as type `MovieExtraInt`.'] -Line 301: Unexpected errors ['typeddicts_extra_items.py:301:4 Assert type [70]: Expected `List[Tuple[str, Union[int, str]]]` but got `List[Tuple[str, object]]`.'] -Line 302: Unexpected errors ['typeddicts_extra_items.py:302:4 Assert type [70]: Expected `List[Union[int, str]]` but got `List[object]`.'] -Line 310: Unexpected errors ['typeddicts_extra_items.py:310:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 317: Unexpected errors ['typeddicts_extra_items.py:317:4 Incompatible variable type [9]: v is declared to have type `Dict[str, int]` but is used as type `IntDict`.'] -Line 320: Unexpected errors ['typeddicts_extra_items.py:320:40 TypedDict initialization error [55]: TypedDict `IntDictWithNum` has no field `bar`.'] -Line 321: Unexpected errors ['typeddicts_extra_items.py:321:0 Incompatible variable type [9]: regular_dict is declared to have type `Dict[str, int]` but is used as type `IntDictWithNum`.'] -Line 328: Unexpected errors ['typeddicts_extra_items.py:328:0 Undefined attribute [16]: `IntDictWithNum` has no attribute `clear`.'] -Line 330: Unexpected errors ['typeddicts_extra_items.py:330:0 Assert type [70]: Expected `Tuple[str, int]` but got `typing.Any`.', 'typeddicts_extra_items.py:330:12 Undefined attribute [16]: `IntDictWithNum` has no attribute `popitem`.'] -Line 333: Unexpected errors ["typeddicts_extra_items.py:333:26 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num')."] -Line 334: Unexpected errors ["typeddicts_extra_items.py:334:30 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num')."] +Line 155: Unexpected errors ['typeddicts_extra_items.py:155:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 165: Unexpected errors ['typeddicts_extra_items.py:165:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 171: Unexpected errors ['typeddicts_extra_items.py:171:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 181: Unexpected errors ['typeddicts_extra_items.py:181:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 207: Unexpected errors ['typeddicts_extra_items.py:207:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 214: Unexpected errors ['typeddicts_extra_items.py:214:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 225: Unexpected errors ['typeddicts_extra_items.py:225:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 228: Unexpected errors ['typeddicts_extra_items.py:228:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 232: Unexpected errors ['typeddicts_extra_items.py:232:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 245: Unexpected errors ['typeddicts_extra_items.py:245:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 248: Unexpected errors ['typeddicts_extra_items.py:248:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 251: Unexpected errors ['typeddicts_extra_items.py:251:27 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] +Line 252: Unexpected errors ['typeddicts_extra_items.py:252:27 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `description`.'] +Line 263: Unexpected errors ['typeddicts_extra_items.py:263:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] +Line 277: Unexpected errors ['typeddicts_extra_items.py:277:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 281: Unexpected errors ['typeddicts_extra_items.py:281:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ExtraMovie.__init__`.'] +Line 286: Unexpected errors ['typeddicts_extra_items.py:286:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`.'] +Line 296: Unexpected errors ['typeddicts_extra_items.py:296:28 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `summary`.'] +Line 297: Unexpected errors ['typeddicts_extra_items.py:297:0 Incompatible variable type [9]: str_mapping is declared to have type `Mapping[str, str]` but is used as type `MovieExtraStr`.'] +Line 299: Unexpected errors ['typeddicts_extra_items.py:299:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] +Line 301: Unexpected errors ['typeddicts_extra_items.py:301:0 Incompatible variable type [9]: int_str_mapping is declared to have type `Mapping[str, Union[int, str]]` but is used as type `MovieExtraInt`.'] +Line 307: Unexpected errors ['typeddicts_extra_items.py:307:4 Assert type [70]: Expected `List[Tuple[str, Union[int, str]]]` but got `List[Tuple[str, object]]`.'] +Line 308: Unexpected errors ['typeddicts_extra_items.py:308:4 Assert type [70]: Expected `List[Union[int, str]]` but got `List[object]`.'] +Line 316: Unexpected errors ['typeddicts_extra_items.py:316:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 323: Unexpected errors ['typeddicts_extra_items.py:323:4 Incompatible variable type [9]: v is declared to have type `Dict[str, int]` but is used as type `IntDict`.'] +Line 326: Unexpected errors ['typeddicts_extra_items.py:326:40 TypedDict initialization error [55]: TypedDict `IntDictWithNum` has no field `bar`.'] +Line 327: Unexpected errors ['typeddicts_extra_items.py:327:0 Incompatible variable type [9]: regular_dict is declared to have type `Dict[str, int]` but is used as type `IntDictWithNum`.'] +Line 334: Unexpected errors ['typeddicts_extra_items.py:334:0 Undefined attribute [16]: `IntDictWithNum` has no attribute `clear`.'] +Line 336: Unexpected errors ['typeddicts_extra_items.py:336:0 Assert type [70]: Expected `Tuple[str, int]` but got `typing.Any`.', 'typeddicts_extra_items.py:336:12 Undefined attribute [16]: `IntDictWithNum` has no attribute `popitem`.'] +Line 339: Unexpected errors ["typeddicts_extra_items.py:339:26 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num')."] +Line 340: Unexpected errors ["typeddicts_extra_items.py:340:30 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num')."] """ output = """ typeddicts_extra_items.py:11:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. @@ -88,52 +89,53 @@ typeddicts_extra_items.py:88:0 Unexpected keyword [28]: Unexpected keyword argum typeddicts_extra_items.py:100:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. typeddicts_extra_items.py:103:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. typeddicts_extra_items.py:106:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:111:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:109:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. typeddicts_extra_items.py:114:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:121:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:125:4 Invalid TypedDict operation [54]: Cannot delete required field `name` from TypedDict `MovieEI`. -typeddicts_extra_items.py:126:14 TypedDict accessed with a missing key [27]: TypedDict `MovieEI` has no key `year`. -typeddicts_extra_items.py:134:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:140:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `unpack_no_extra`. -typeddicts_extra_items.py:141:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `unpack_extra`. -typeddicts_extra_items.py:146:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:117:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:124:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:128:4 Invalid TypedDict operation [54]: Cannot delete required field `name` from TypedDict `MovieEI`. +typeddicts_extra_items.py:129:14 TypedDict accessed with a missing key [27]: TypedDict `MovieEI` has no key `year`. +typeddicts_extra_items.py:137:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:143:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `unpack_no_extra`. +typeddicts_extra_items.py:144:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `unpack_extra`. typeddicts_extra_items.py:149:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. typeddicts_extra_items.py:152:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:162:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:168:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:155:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:165:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. typeddicts_extra_items.py:171:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:178:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:201:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:208:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:219:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:222:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:226:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:239:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:242:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:245:27 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. -typeddicts_extra_items.py:246:27 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `description`. -typeddicts_extra_items.py:257:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. -typeddicts_extra_items.py:269:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `NonClosedMovie.__init__`. -typeddicts_extra_items.py:271:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:275:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ExtraMovie.__init__`. -typeddicts_extra_items.py:276:0 Unexpected keyword [28]: Unexpected keyword argument `language` to call `ExtraMovie.__init__`. -typeddicts_extra_items.py:280:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. -typeddicts_extra_items.py:284:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ClosedMovie.__init__`. -typeddicts_extra_items.py:290:28 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `summary`. -typeddicts_extra_items.py:291:0 Incompatible variable type [9]: str_mapping is declared to have type `Mapping[str, str]` but is used as type `MovieExtraStr`. -typeddicts_extra_items.py:293:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. -typeddicts_extra_items.py:294:0 Incompatible variable type [9]: int_mapping is declared to have type `Mapping[str, int]` but is used as type `MovieExtraInt`. -typeddicts_extra_items.py:295:0 Incompatible variable type [9]: int_str_mapping is declared to have type `Mapping[str, Union[int, str]]` but is used as type `MovieExtraInt`. -typeddicts_extra_items.py:301:4 Assert type [70]: Expected `List[Tuple[str, Union[int, str]]]` but got `List[Tuple[str, object]]`. -typeddicts_extra_items.py:302:4 Assert type [70]: Expected `List[Union[int, str]]` but got `List[object]`. -typeddicts_extra_items.py:310:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:317:4 Incompatible variable type [9]: v is declared to have type `Dict[str, int]` but is used as type `IntDict`. -typeddicts_extra_items.py:320:40 TypedDict initialization error [55]: TypedDict `IntDictWithNum` has no field `bar`. -typeddicts_extra_items.py:321:0 Incompatible variable type [9]: regular_dict is declared to have type `Dict[str, int]` but is used as type `IntDictWithNum`. -typeddicts_extra_items.py:328:0 Undefined attribute [16]: `IntDictWithNum` has no attribute `clear`. -typeddicts_extra_items.py:330:0 Assert type [70]: Expected `Tuple[str, int]` but got `typing.Any`. -typeddicts_extra_items.py:330:12 Undefined attribute [16]: `IntDictWithNum` has no attribute `popitem`. -typeddicts_extra_items.py:333:26 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num'). -typeddicts_extra_items.py:334:30 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num'). -typeddicts_extra_items.py:343:4 Incompatible variable type [9]: int_dict is declared to have type `IntDict` but is used as type `Dict[str, int]`. +typeddicts_extra_items.py:174:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:181:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:207:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:214:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:225:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:228:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:232:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:245:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:248:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:251:27 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. +typeddicts_extra_items.py:252:27 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `description`. +typeddicts_extra_items.py:263:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. +typeddicts_extra_items.py:275:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `NonClosedMovie.__init__`. +typeddicts_extra_items.py:277:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:281:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ExtraMovie.__init__`. +typeddicts_extra_items.py:282:0 Unexpected keyword [28]: Unexpected keyword argument `language` to call `ExtraMovie.__init__`. +typeddicts_extra_items.py:286:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. +typeddicts_extra_items.py:290:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ClosedMovie.__init__`. +typeddicts_extra_items.py:296:28 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `summary`. +typeddicts_extra_items.py:297:0 Incompatible variable type [9]: str_mapping is declared to have type `Mapping[str, str]` but is used as type `MovieExtraStr`. +typeddicts_extra_items.py:299:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. +typeddicts_extra_items.py:300:0 Incompatible variable type [9]: int_mapping is declared to have type `Mapping[str, int]` but is used as type `MovieExtraInt`. +typeddicts_extra_items.py:301:0 Incompatible variable type [9]: int_str_mapping is declared to have type `Mapping[str, Union[int, str]]` but is used as type `MovieExtraInt`. +typeddicts_extra_items.py:307:4 Assert type [70]: Expected `List[Tuple[str, Union[int, str]]]` but got `List[Tuple[str, object]]`. +typeddicts_extra_items.py:308:4 Assert type [70]: Expected `List[Union[int, str]]` but got `List[object]`. +typeddicts_extra_items.py:316:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:323:4 Incompatible variable type [9]: v is declared to have type `Dict[str, int]` but is used as type `IntDict`. +typeddicts_extra_items.py:326:40 TypedDict initialization error [55]: TypedDict `IntDictWithNum` has no field `bar`. +typeddicts_extra_items.py:327:0 Incompatible variable type [9]: regular_dict is declared to have type `Dict[str, int]` but is used as type `IntDictWithNum`. +typeddicts_extra_items.py:334:0 Undefined attribute [16]: `IntDictWithNum` has no attribute `clear`. +typeddicts_extra_items.py:336:0 Assert type [70]: Expected `Tuple[str, int]` but got `typing.Any`. +typeddicts_extra_items.py:336:12 Undefined attribute [16]: `IntDictWithNum` has no attribute `popitem`. +typeddicts_extra_items.py:339:26 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num'). +typeddicts_extra_items.py:340:30 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num'). +typeddicts_extra_items.py:349:4 Incompatible variable type [9]: int_dict is declared to have type `IntDict` but is used as type `Dict[str, int]`. """ diff --git a/conformance/results/pyright/typeddicts_extra_items.toml b/conformance/results/pyright/typeddicts_extra_items.toml index 8bdb0fab..d288332c 100644 --- a/conformance/results/pyright/typeddicts_extra_items.toml +++ b/conformance/results/pyright/typeddicts_extra_items.toml @@ -1,6 +1,11 @@ -conformant = "Pass" -conformance_automated = "Pass" +conformant = "Partial" +notes = """ +Does not flag illegal use of `closed=False` when inheriting from a non-open TypedDict. +""" +conformance_automated = "Fail" errors_diff = """ +Line 67: Expected 1 errors +Line 73: Expected 1 errors """ output = """ 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 typeddicts_extra_items.py:39:54 - error: Type "dict[str, str | None]" is not assignable to declared type "InheritedMovie"   "None" is not assignable to "int" (reportAssignmentType) typeddicts_extra_items.py:49:35 - error: Expected "closed" parameter to have a value of True or False (reportGeneralTypeIssues) -typeddicts_extra_items.py:67:7 - error: Base class "ClosedBase" is a TypedDict that limits the type of extra items to type "Never" -  Cannot add item "age" (reportIncompatibleVariableOverride) -typeddicts_extra_items.py:73:7 - error: Base class "ExtraItemsBase" is a TypedDict that limits the type of extra items to type "int" -  Cannot add item "age" because it must be NotRequired (reportIncompatibleVariableOverride) typeddicts_extra_items.py:91:7 - error: Base class "MovieA" is a TypedDict that limits the type of extra items to type "Never"   Cannot add item "age" (reportIncompatibleVariableOverride) typeddicts_extra_items.py:94:7 - error: Base class "MovieB" is a TypedDict that limits the type of extra items to type "Never"   Cannot add item "age" (reportIncompatibleVariableOverride) -typeddicts_extra_items.py:111:50 - error: "Required" is not allowed in this context (reportInvalidTypeForm) -typeddicts_extra_items.py:114:57 - error: "NotRequired" is not allowed in this context (reportInvalidTypeForm) -typeddicts_extra_items.py:125:9 - error: Could not delete item in TypedDict +typeddicts_extra_items.py:109:7 - error: Base class "ExtraItemsBase" is a TypedDict that limits the type of extra items to type "int" +  Cannot add item "extra_items" with type "Never" (reportIncompatibleVariableOverride) +typeddicts_extra_items.py:114:50 - error: "Required" is not allowed in this context (reportInvalidTypeForm) +typeddicts_extra_items.py:117:57 - error: "NotRequired" is not allowed in this context (reportInvalidTypeForm) +typeddicts_extra_items.py:128:9 - error: Could not delete item in TypedDict   "name" is a required key and cannot be deleted (reportGeneralTypeIssues) -typeddicts_extra_items.py:140:48 - error: No parameter named "year" (reportCallIssue) -typeddicts_extra_items.py:171:7 - error: Base class "Parent" is a TypedDict that limits the type of extra items to type "int | None" +typeddicts_extra_items.py:143:48 - error: No parameter named "year" (reportCallIssue) +typeddicts_extra_items.py:174:7 - error: Base class "Parent" is a TypedDict that limits the type of extra items to type "int | None"   Cannot add item "extra_items" with type "int" (reportIncompatibleVariableOverride) -typeddicts_extra_items.py:181:7 - error: Base class "MovieBase2" is a TypedDict that limits the type of extra items to type "int | None" -  Cannot add item "year" because it must be NotRequired (reportIncompatibleVariableOverride) typeddicts_extra_items.py:184:7 - error: Base class "MovieBase2" is a TypedDict that limits the type of extra items to type "int | None" +  Cannot add item "year" because it must be NotRequired (reportIncompatibleVariableOverride) +typeddicts_extra_items.py:187:7 - error: Base class "MovieBase2" is a TypedDict that limits the type of extra items to type "int | None"   Cannot add item "year" with type "int" (reportIncompatibleVariableOverride) -typeddicts_extra_items.py:206:22 - error: Type "MovieDetails" is not assignable to declared type "MovieBase2" +typeddicts_extra_items.py:193:7 - error: Base class "MovieBase" is a TypedDict that limits the type of extra items to type "int | None" +  Cannot add item "director" with type "str" (reportIncompatibleVariableOverride) +typeddicts_extra_items.py:212:22 - error: Type "MovieDetails" is not assignable to declared type "MovieBase2"   Type of "year" is incompatible with type of "extra_items" in "MovieBase2"     Type "int" is not assignable to type "int | None"       "int" is not assignable to "None" (reportAssignmentType) -typeddicts_extra_items.py:213:22 - error: Type "MovieWithYear2" is not assignable to declared type "MovieBase2" +typeddicts_extra_items.py:219:22 - error: Type "MovieWithYear2" is not assignable to declared type "MovieBase2"   "year" is not required in "MovieBase2" (reportAssignmentType) -typeddicts_extra_items.py:233:19 - error: Type "MovieDetails5" is not assignable to declared type "MovieSI" +typeddicts_extra_items.py:239:19 - error: Type "MovieDetails5" is not assignable to declared type "MovieSI"   Type of "actors" is incompatible with type of "extra_items" in "MovieSI"     Type "list[str]" is not assignable to type "str | int"       "list[str]" is not assignable to "str"       "list[str]" is not assignable to "int" (reportAssignmentType) -typeddicts_extra_items.py:247:13 - error: Type "MovieExtraStr" is not assignable to declared type "MovieExtraInt" +typeddicts_extra_items.py:253:13 - error: Type "MovieExtraStr" is not assignable to declared type "MovieExtraInt"   Type of "extra_items" is incompatible with type of "extra_items" in "MovieExtraStr"     "str" is not assignable to "int" (reportAssignmentType) -typeddicts_extra_items.py:248:13 - error: Type "MovieExtraInt" is not assignable to declared type "MovieExtraStr" +typeddicts_extra_items.py:254:13 - error: Type "MovieExtraInt" is not assignable to declared type "MovieExtraStr"   Type of "extra_items" is incompatible with type of "extra_items" in "MovieExtraInt"     "int" is not assignable to "str" (reportAssignmentType) -typeddicts_extra_items.py:259:14 - error: Type "MovieNotClosed" is not assignable to declared type "MovieExtraInt" +typeddicts_extra_items.py:265:14 - error: Type "MovieNotClosed" is not assignable to declared type "MovieExtraInt"   Type of "extra_items" is incompatible with type of "extra_items" in "MovieNotClosed"     "object" is not assignable to "int" (reportAssignmentType) -typeddicts_extra_items.py:269:1 - error: No overloads for "__init__" match the provided arguments +typeddicts_extra_items.py:275:1 - error: No overloads for "__init__" match the provided arguments   Argument types: (Literal['No Country for Old Men'], Literal[2007]) (reportCallIssue) -typeddicts_extra_items.py:276:52 - error: Argument of type "Literal['English']" cannot be assigned to parameter "language" of type "int" in function "__init__" +typeddicts_extra_items.py:282:52 - error: Argument of type "Literal['English']" cannot be assigned to parameter "language" of type "int" in function "__init__"   "Literal['English']" is not assignable to "int" (reportArgumentType) -typeddicts_extra_items.py:284:1 - error: No overloads for "__init__" match the provided arguments +typeddicts_extra_items.py:290:1 - error: No overloads for "__init__" match the provided arguments   Argument types: (Literal['No Country for Old Men'], Literal[2007]) (reportCallIssue) -typeddicts_extra_items.py:294:34 - error: Type "MovieExtraInt" is not assignable to declared type "Mapping[str, int]" +typeddicts_extra_items.py:300:34 - error: Type "MovieExtraInt" is not assignable to declared type "Mapping[str, int]"   "Mapping[str, str | int]" is not assignable to "Mapping[str, int]"     Type parameter "_VT_co@Mapping" is covariant, but "str | int" is not a subtype of "int"       Type "str | int" is not assignable to type "int"         "str" is not assignable to "int" (reportAssignmentType) -typeddicts_extra_items.py:343:25 - error: Type "dict[str, int]" is not assignable to declared type "IntDict" +typeddicts_extra_items.py:349:25 - error: Type "dict[str, int]" is not assignable to declared type "IntDict"   "dict[str, int]" is not assignable to "IntDict" (reportAssignmentType) """ diff --git a/conformance/results/results.html b/conformance/results/results.html index 151069d7..cf4dfa2b 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -817,7 +817,7 @@

Python Type System Conformance Test Results

     typeddicts_extra_items
Unsupported

Not supported.

-Pass +
Partial

Does not flag illegal use of `closed=False` when inheriting from a non-open TypedDict.

Unsupported

Not supported.

Unsupported

Not supported.

diff --git a/conformance/results/zuban/typeddicts_extra_items.toml b/conformance/results/zuban/typeddicts_extra_items.toml index 0cc9199f..68e73434 100644 --- a/conformance/results/zuban/typeddicts_extra_items.toml +++ b/conformance/results/zuban/typeddicts_extra_items.toml @@ -5,16 +5,17 @@ Not supported. conformance_automated = "Fail" errors_diff = """ Line 22: Expected 1 errors -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 +Line 212: Expected 1 errors +Line 219: Expected 1 errors +Line 239: Expected 1 errors +Line 253: Expected 1 errors +Line 254: Expected 1 errors +Line 265: Expected 1 errors Lines 91, 92: Expected error (tag 'MovieC') Lines 94, 95: Expected error (tag 'MovieD') +Lines 184, 185: Expected error (tag 'MovieRequiredYear') +Lines 187, 188: Expected error (tag 'MovieNotRequiredYear') +Lines 193, 194: Expected error (tag 'MovieWithDirector') Line 11: Unexpected errors ['typeddicts_extra_items.py:11: error: Unexpected keyword argument "extra_items" for TypedDict'] Line 14: Unexpected errors ['typeddicts_extra_items.py:14: error: Extra key "novel_adaptation" for TypedDict "Movie"'] Line 19: Unexpected errors ['typeddicts_extra_items.py:19: error: Unexpected keyword argument "extra_items" for "TypedDict"'] @@ -29,43 +30,43 @@ Line 88: Unexpected errors ['typeddicts_extra_items.py:88: error: Unexpected key Line 100: Unexpected errors ['typeddicts_extra_items.py:100: error: Unexpected keyword argument "extra_items" for TypedDict'] Line 103: Unexpected errors ['typeddicts_extra_items.py:103: error: Unexpected keyword argument "closed" for TypedDict'] Line 106: Unexpected errors ['typeddicts_extra_items.py:106: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 121: Unexpected errors ['typeddicts_extra_items.py:121: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 126: Unexpected errors ['typeddicts_extra_items.py:126: error: TypedDict "MovieEI" has no key "year"'] -Line 134: Unexpected errors ['typeddicts_extra_items.py:134: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 141: Unexpected errors ['typeddicts_extra_items.py:141: error: Unexpected keyword argument "year" for "unpack_extra"'] -Line 146: Unexpected errors ['typeddicts_extra_items.py:146: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 124: Unexpected errors ['typeddicts_extra_items.py:124: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 129: Unexpected errors ['typeddicts_extra_items.py:129: error: TypedDict "MovieEI" has no key "year"'] +Line 137: Unexpected errors ['typeddicts_extra_items.py:137: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 144: Unexpected errors ['typeddicts_extra_items.py:144: error: Unexpected keyword argument "year" for "unpack_extra"'] Line 149: Unexpected errors ['typeddicts_extra_items.py:149: error: Unexpected keyword argument "extra_items" for TypedDict'] Line 152: Unexpected errors ['typeddicts_extra_items.py:152: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 162: Unexpected errors ['typeddicts_extra_items.py:162: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 168: Unexpected errors ['typeddicts_extra_items.py:168: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 178: Unexpected errors ['typeddicts_extra_items.py:178: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 201: Unexpected errors ['typeddicts_extra_items.py:201: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 208: Unexpected errors ['typeddicts_extra_items.py:208: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 219: Unexpected errors ['typeddicts_extra_items.py:219: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 222: Unexpected errors ['typeddicts_extra_items.py:222: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 226: Unexpected errors ['typeddicts_extra_items.py:226: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 239: Unexpected errors ['typeddicts_extra_items.py:239: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 242: Unexpected errors ['typeddicts_extra_items.py:242: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 245: Unexpected errors ['typeddicts_extra_items.py:245: error: Extra key "year" for TypedDict "MovieExtraInt"'] -Line 246: Unexpected errors ['typeddicts_extra_items.py:246: error: Extra key "description" for TypedDict "MovieExtraStr"'] -Line 257: Unexpected errors ['typeddicts_extra_items.py:257: error: Extra key "year" for TypedDict "MovieExtraInt"'] -Line 271: Unexpected errors ['typeddicts_extra_items.py:271: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 275: Unexpected errors ['typeddicts_extra_items.py:275: error: Extra key "year" for TypedDict "ExtraMovie"'] -Line 280: Unexpected errors ['typeddicts_extra_items.py:280: error: Unexpected keyword argument "closed" for TypedDict'] -Line 290: Unexpected errors ['typeddicts_extra_items.py:290: error: Extra key "summary" for TypedDict "MovieExtraStr"'] -Line 291: Unexpected errors ['typeddicts_extra_items.py:291: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]")'] -Line 293: Unexpected errors ['typeddicts_extra_items.py:293: error: Extra key "year" for TypedDict "MovieExtraInt"'] -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]")'] -Line 301: Unexpected errors ['typeddicts_extra_items.py:301: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]"'] -Line 302: Unexpected errors ['typeddicts_extra_items.py:302: error: Expression is of type "list[object]", not "list[int | str]"'] -Line 310: Unexpected errors ['typeddicts_extra_items.py:310: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 317: Unexpected errors ['typeddicts_extra_items.py:317: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]")'] -Line 320: Unexpected errors ['typeddicts_extra_items.py:320: error: Extra key "bar" for TypedDict "IntDictWithNum"'] -Line 321: Unexpected errors ['typeddicts_extra_items.py:321: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]")'] -Line 328: Unexpected errors ['typeddicts_extra_items.py:328: error: "IntDictWithNum" has no attribute "clear"'] -Line 330: Unexpected errors ['typeddicts_extra_items.py:330: error: Expression is of type "Any", not "tuple[str, int]"', 'typeddicts_extra_items.py:330: error: "IntDictWithNum" has no attribute "popitem"'] -Line 333: Unexpected errors ['typeddicts_extra_items.py:333: error: TypedDict key must be a string literal; expected one of ("num")'] -Line 334: Unexpected errors ['typeddicts_extra_items.py:334: error: Expected TypedDict key to be string literal'] +Line 155: Unexpected errors ['typeddicts_extra_items.py:155: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 165: Unexpected errors ['typeddicts_extra_items.py:165: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 171: Unexpected errors ['typeddicts_extra_items.py:171: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 181: Unexpected errors ['typeddicts_extra_items.py:181: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 207: Unexpected errors ['typeddicts_extra_items.py:207: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 214: Unexpected errors ['typeddicts_extra_items.py:214: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 225: Unexpected errors ['typeddicts_extra_items.py:225: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 228: Unexpected errors ['typeddicts_extra_items.py:228: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 232: Unexpected errors ['typeddicts_extra_items.py:232: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 245: Unexpected errors ['typeddicts_extra_items.py:245: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 248: Unexpected errors ['typeddicts_extra_items.py:248: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 251: Unexpected errors ['typeddicts_extra_items.py:251: error: Extra key "year" for TypedDict "MovieExtraInt"'] +Line 252: Unexpected errors ['typeddicts_extra_items.py:252: error: Extra key "description" for TypedDict "MovieExtraStr"'] +Line 263: Unexpected errors ['typeddicts_extra_items.py:263: error: Extra key "year" for TypedDict "MovieExtraInt"'] +Line 277: Unexpected errors ['typeddicts_extra_items.py:277: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 281: Unexpected errors ['typeddicts_extra_items.py:281: error: Extra key "year" for TypedDict "ExtraMovie"'] +Line 286: Unexpected errors ['typeddicts_extra_items.py:286: error: Unexpected keyword argument "closed" for TypedDict'] +Line 296: Unexpected errors ['typeddicts_extra_items.py:296: error: Extra key "summary" for TypedDict "MovieExtraStr"'] +Line 297: Unexpected errors ['typeddicts_extra_items.py:297: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]")'] +Line 299: Unexpected errors ['typeddicts_extra_items.py:299: error: Extra key "year" for TypedDict "MovieExtraInt"'] +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]")'] +Line 307: Unexpected errors ['typeddicts_extra_items.py:307: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]"'] +Line 308: Unexpected errors ['typeddicts_extra_items.py:308: error: Expression is of type "list[object]", not "list[int | str]"'] +Line 316: Unexpected errors ['typeddicts_extra_items.py:316: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 323: Unexpected errors ['typeddicts_extra_items.py:323: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]")'] +Line 326: Unexpected errors ['typeddicts_extra_items.py:326: error: Extra key "bar" for TypedDict "IntDictWithNum"'] +Line 327: Unexpected errors ['typeddicts_extra_items.py:327: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]")'] +Line 334: Unexpected errors ['typeddicts_extra_items.py:334: error: "IntDictWithNum" has no attribute "clear"'] +Line 336: Unexpected errors ['typeddicts_extra_items.py:336: error: Expression is of type "Any", not "tuple[str, int]"', 'typeddicts_extra_items.py:336: error: "IntDictWithNum" has no attribute "popitem"'] +Line 339: Unexpected errors ['typeddicts_extra_items.py:339: error: TypedDict key must be a string literal; expected one of ("num")'] +Line 340: Unexpected errors ['typeddicts_extra_items.py:340: error: Expected TypedDict key to be string literal'] """ output = """ typeddicts_extra_items.py:11: error: Unexpected keyword argument "extra_items" for TypedDict @@ -88,52 +89,53 @@ typeddicts_extra_items.py:88: error: Unexpected keyword argument "closed" for Ty typeddicts_extra_items.py:100: error: Unexpected keyword argument "extra_items" for TypedDict typeddicts_extra_items.py:103: error: Unexpected keyword argument "closed" for TypedDict typeddicts_extra_items.py:106: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:111: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:109: error: Unexpected keyword argument "closed" for TypedDict typeddicts_extra_items.py:114: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:121: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:125: error: Key "name" of TypedDict "MovieEI" cannot be deleted -typeddicts_extra_items.py:126: error: TypedDict "MovieEI" has no key "year" -typeddicts_extra_items.py:134: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:140: error: Unexpected keyword argument "year" for "unpack_no_extra" -typeddicts_extra_items.py:141: error: Unexpected keyword argument "year" for "unpack_extra" -typeddicts_extra_items.py:146: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:117: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:124: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:128: error: Key "name" of TypedDict "MovieEI" cannot be deleted +typeddicts_extra_items.py:129: error: TypedDict "MovieEI" has no key "year" +typeddicts_extra_items.py:137: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:143: error: Unexpected keyword argument "year" for "unpack_no_extra" +typeddicts_extra_items.py:144: error: Unexpected keyword argument "year" for "unpack_extra" typeddicts_extra_items.py:149: error: Unexpected keyword argument "extra_items" for TypedDict typeddicts_extra_items.py:152: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:162: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:168: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:155: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:165: error: Unexpected keyword argument "extra_items" for TypedDict typeddicts_extra_items.py:171: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:178: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:201: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:208: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:219: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:222: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:226: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:239: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:242: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:245: error: Extra key "year" for TypedDict "MovieExtraInt" -typeddicts_extra_items.py:246: error: Extra key "description" for TypedDict "MovieExtraStr" -typeddicts_extra_items.py:257: error: Extra key "year" for TypedDict "MovieExtraInt" -typeddicts_extra_items.py:269: error: Extra key "year" for TypedDict "NonClosedMovie" -typeddicts_extra_items.py:271: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:275: error: Extra key "year" for TypedDict "ExtraMovie" -typeddicts_extra_items.py:276: error: Extra key "language" for TypedDict "ExtraMovie" -typeddicts_extra_items.py:280: error: Unexpected keyword argument "closed" for TypedDict -typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ClosedMovie" -typeddicts_extra_items.py:290: error: Extra key "summary" for TypedDict "MovieExtraStr" -typeddicts_extra_items.py:291: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") -typeddicts_extra_items.py:293: error: Extra key "year" for TypedDict "MovieExtraInt" -typeddicts_extra_items.py:294: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int]") -typeddicts_extra_items.py:295: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") -typeddicts_extra_items.py:301: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" -typeddicts_extra_items.py:302: error: Expression is of type "list[object]", not "list[int | str]" -typeddicts_extra_items.py:310: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:317: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") -typeddicts_extra_items.py:320: error: Extra key "bar" for TypedDict "IntDictWithNum" -typeddicts_extra_items.py:321: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") -typeddicts_extra_items.py:328: error: "IntDictWithNum" has no attribute "clear" -typeddicts_extra_items.py:330: error: Expression is of type "Any", not "tuple[str, int]" -typeddicts_extra_items.py:330: error: "IntDictWithNum" has no attribute "popitem" -typeddicts_extra_items.py:333: error: TypedDict key must be a string literal; expected one of ("num") -typeddicts_extra_items.py:334: error: Expected TypedDict key to be string literal -typeddicts_extra_items.py:343: error: Incompatible types in assignment (expression has type "dict[str, int]", variable has type "IntDict") +typeddicts_extra_items.py:174: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:181: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:207: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:214: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:225: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:228: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:232: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:245: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:248: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:251: error: Extra key "year" for TypedDict "MovieExtraInt" +typeddicts_extra_items.py:252: error: Extra key "description" for TypedDict "MovieExtraStr" +typeddicts_extra_items.py:263: error: Extra key "year" for TypedDict "MovieExtraInt" +typeddicts_extra_items.py:275: error: Extra key "year" for TypedDict "NonClosedMovie" +typeddicts_extra_items.py:277: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:281: error: Extra key "year" for TypedDict "ExtraMovie" +typeddicts_extra_items.py:282: error: Extra key "language" for TypedDict "ExtraMovie" +typeddicts_extra_items.py:286: error: Unexpected keyword argument "closed" for TypedDict +typeddicts_extra_items.py:290: error: Extra key "year" for TypedDict "ClosedMovie" +typeddicts_extra_items.py:296: error: Extra key "summary" for TypedDict "MovieExtraStr" +typeddicts_extra_items.py:297: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") +typeddicts_extra_items.py:299: error: Extra key "year" for TypedDict "MovieExtraInt" +typeddicts_extra_items.py:300: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int]") +typeddicts_extra_items.py:301: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") +typeddicts_extra_items.py:307: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" +typeddicts_extra_items.py:308: error: Expression is of type "list[object]", not "list[int | str]" +typeddicts_extra_items.py:316: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:323: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") +typeddicts_extra_items.py:326: error: Extra key "bar" for TypedDict "IntDictWithNum" +typeddicts_extra_items.py:327: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") +typeddicts_extra_items.py:334: error: "IntDictWithNum" has no attribute "clear" +typeddicts_extra_items.py:336: error: Expression is of type "Any", not "tuple[str, int]" +typeddicts_extra_items.py:336: error: "IntDictWithNum" has no attribute "popitem" +typeddicts_extra_items.py:339: error: TypedDict key must be a string literal; expected one of ("num") +typeddicts_extra_items.py:340: error: Expected TypedDict key to be string literal +typeddicts_extra_items.py:349: error: Incompatible types in assignment (expression has type "dict[str, int]", variable has type "IntDict") """ diff --git a/conformance/tests/typeddicts_extra_items.py b/conformance/tests/typeddicts_extra_items.py index b0a797ee..4a7fe104 100644 --- a/conformance/tests/typeddicts_extra_items.py +++ b/conformance/tests/typeddicts_extra_items.py @@ -65,13 +65,13 @@ class ClosedBase(TypedDict, closed=True): name: str class IllegalChild1(ClosedBase, closed=False): # E: Cannot set 'closed=False' when superclass is 'closed=True' - age: int + pass class ExtraItemsBase(TypedDict, extra_items=int): name: str class IllegalChild2(ExtraItemsBase, closed=False): # E: Cannot set 'closed=False' when superclass has 'extra_items' - age: int + pass # > If ``closed`` is not provided, the behavior is inherited from the superclass. # > If the superclass is TypedDict itself or the superclass does not have ``closed=True`` @@ -106,6 +106,9 @@ class MovieClosed(MovieES, closed=True): # OK class MovieNever(MovieES, extra_items=Never): # OK, but 'closed=True' is preferred pass +class IllegalCloseNonReadOnly(ExtraItemsBase, closed=True): # E: Cannot set 'closed=True' when superclass has non-read-only 'extra_items' + pass + # > It is an error to use ``Required[]`` or ``NotRequired[]`` with ``extra_items``. class IllegalExtraItemsTD(TypedDict, extra_items=Required[int]): # E: 'extra_items' value cannot be 'Required[...]' @@ -178,15 +181,18 @@ class Child(Parent, extra_items=int): # E: Cannot change 'extra_items' type unle class MovieBase2(TypedDict, extra_items=int | None): name: str -class MovieRequiredYear(MovieBase2): # E: Required key 'year' is not known to 'MovieBase' - year: int | None +class MovieRequiredYear(MovieBase2): # E[MovieRequiredYear]: Required key 'year' is not known to 'MovieBase' + year: int | None # E[MovieRequiredYear] -class MovieNotRequiredYear(MovieBase2): # E: 'int | None' is not consistent with 'int' - year: NotRequired[int] +class MovieNotRequiredYear(MovieBase2): # E[MovieNotRequiredYear]: 'int | None' is not consistent with 'int' + year: NotRequired[int] # E[MovieNotRequiredYear] class MovieWithYear(MovieBase): # OK year: NotRequired[int | None] +class MovieWithDirector(MovieBase): # E[MovieWithDirector]: 'str' is not assignable to 'int | None' + director: str # E[MovieWithDirector] + # > Let ``S`` be the set of keys of the explicitly defined items on a TypedDict # > type. If it specifies ``extra_items=T``, the TypedDict type is considered to # > have an infinite set of items that all satisfy the following conditions. From 59e9299b5a8da88d68f3f9a6c0a374cbdbd9e1a7 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Tue, 19 Aug 2025 20:46:59 -0700 Subject: [PATCH 2/2] Add BookBase base class. --- .../results/mypy/typeddicts_extra_items.toml | 128 +++++++++--------- .../results/pyre/typeddicts_extra_items.toml | 128 +++++++++--------- .../pyright/typeddicts_extra_items.toml | 26 ++-- .../results/zuban/typeddicts_extra_items.toml | 128 +++++++++--------- conformance/tests/typeddicts_extra_items.py | 9 +- 5 files changed, 214 insertions(+), 205 deletions(-) diff --git a/conformance/results/mypy/typeddicts_extra_items.toml b/conformance/results/mypy/typeddicts_extra_items.toml index bff0c8b9..1fdda3d4 100644 --- a/conformance/results/mypy/typeddicts_extra_items.toml +++ b/conformance/results/mypy/typeddicts_extra_items.toml @@ -4,17 +4,17 @@ Not supported. """ conformance_automated = "Fail" errors_diff = """ -Line 212: Expected 1 errors -Line 219: Expected 1 errors -Line 239: Expected 1 errors -Line 253: Expected 1 errors -Line 254: Expected 1 errors -Line 265: Expected 1 errors +Line 215: Expected 1 errors +Line 222: Expected 1 errors +Line 242: Expected 1 errors +Line 256: Expected 1 errors +Line 257: Expected 1 errors +Line 268: Expected 1 errors Lines 91, 92: Expected error (tag 'MovieC') Lines 94, 95: Expected error (tag 'MovieD') Lines 184, 185: Expected error (tag 'MovieRequiredYear') Lines 187, 188: Expected error (tag 'MovieNotRequiredYear') -Lines 193, 194: Expected error (tag 'MovieWithDirector') +Lines 196, 197: Expected error (tag 'BookWithPublisher') 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]'] @@ -40,33 +40,34 @@ Line 155: Unexpected errors ['typeddicts_extra_items.py:155: error: Unexpected k Line 165: Unexpected errors ['typeddicts_extra_items.py:165: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] Line 171: Unexpected errors ['typeddicts_extra_items.py:171: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] Line 181: Unexpected errors ['typeddicts_extra_items.py:181: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 207: Unexpected errors ['typeddicts_extra_items.py:207: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 214: Unexpected errors ['typeddicts_extra_items.py:214: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 225: Unexpected errors ['typeddicts_extra_items.py:225: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 193: Unexpected errors ['typeddicts_extra_items.py:193: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 210: Unexpected errors ['typeddicts_extra_items.py:210: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 217: Unexpected errors ['typeddicts_extra_items.py:217: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] Line 228: Unexpected errors ['typeddicts_extra_items.py:228: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 232: Unexpected errors ['typeddicts_extra_items.py:232: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 245: Unexpected errors ['typeddicts_extra_items.py:245: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 231: Unexpected errors ['typeddicts_extra_items.py:231: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 235: Unexpected errors ['typeddicts_extra_items.py:235: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] Line 248: Unexpected errors ['typeddicts_extra_items.py:248: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 251: Unexpected errors ['typeddicts_extra_items.py:251: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] -Line 252: Unexpected errors ['typeddicts_extra_items.py:252: error: Extra key "description" for TypedDict "MovieExtraStr" [typeddict-unknown-key]'] -Line 263: Unexpected errors ['typeddicts_extra_items.py:263: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] -Line 277: Unexpected errors ['typeddicts_extra_items.py:277: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 281: Unexpected errors ['typeddicts_extra_items.py:281: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key]'] -Line 286: Unexpected errors ['typeddicts_extra_items.py:286: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] -Line 296: Unexpected errors ['typeddicts_extra_items.py:296: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key]'] -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]'] -Line 299: Unexpected errors ['typeddicts_extra_items.py:299: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] -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]'] -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]'] -Line 308: Unexpected errors ['typeddicts_extra_items.py:308: error: Expression is of type "list[object]", not "list[int | str]" [assert-type]'] -Line 316: Unexpected errors ['typeddicts_extra_items.py:316: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] -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]'] -Line 326: Unexpected errors ['typeddicts_extra_items.py:326: error: Extra key "bar" for TypedDict "IntDictWithNum" [typeddict-unknown-key]'] -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]'] -Line 334: Unexpected errors ['typeddicts_extra_items.py:334: error: "IntDictWithNum" has no attribute "clear" [attr-defined]'] -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]'] -Line 339: Unexpected errors ['typeddicts_extra_items.py:339: error: TypedDict key must be a string literal; expected one of ("num") [literal-required]'] -Line 340: Unexpected errors ['typeddicts_extra_items.py:340: error: Expected TypedDict key to be string literal [misc]'] +Line 251: Unexpected errors ['typeddicts_extra_items.py:251: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 254: Unexpected errors ['typeddicts_extra_items.py:254: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] +Line 255: Unexpected errors ['typeddicts_extra_items.py:255: error: Extra key "description" for TypedDict "MovieExtraStr" [typeddict-unknown-key]'] +Line 266: Unexpected errors ['typeddicts_extra_items.py:266: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] +Line 280: Unexpected errors ['typeddicts_extra_items.py:280: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 284: Unexpected errors ['typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key]'] +Line 289: Unexpected errors ['typeddicts_extra_items.py:289: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]'] +Line 299: Unexpected errors ['typeddicts_extra_items.py:299: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key]'] +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]'] +Line 302: Unexpected errors ['typeddicts_extra_items.py:302: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key]'] +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]'] +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]'] +Line 311: Unexpected errors ['typeddicts_extra_items.py:311: error: Expression is of type "list[object]", not "list[int | str]" [assert-type]'] +Line 319: Unexpected errors ['typeddicts_extra_items.py:319: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]'] +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]'] +Line 329: Unexpected errors ['typeddicts_extra_items.py:329: error: Extra key "bar" for TypedDict "IntDictWithNum" [typeddict-unknown-key]'] +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]'] +Line 337: Unexpected errors ['typeddicts_extra_items.py:337: error: "IntDictWithNum" has no attribute "clear" [attr-defined]'] +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]'] +Line 342: Unexpected errors ['typeddicts_extra_items.py:342: error: TypedDict key must be a string literal; expected one of ("num") [literal-required]'] +Line 343: Unexpected errors ['typeddicts_extra_items.py:343: 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] @@ -109,37 +110,38 @@ typeddicts_extra_items.py:165: error: Unexpected keyword argument "extra_items" typeddicts_extra_items.py:171: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] typeddicts_extra_items.py:174: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] typeddicts_extra_items.py:181: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:207: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:214: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:225: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:193: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:210: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:217: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] typeddicts_extra_items.py:228: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:232: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:245: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:231: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:235: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] typeddicts_extra_items.py:248: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:251: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] -typeddicts_extra_items.py:252: error: Extra key "description" for TypedDict "MovieExtraStr" [typeddict-unknown-key] -typeddicts_extra_items.py:263: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] -typeddicts_extra_items.py:275: error: Extra key "year" for TypedDict "NonClosedMovie" [typeddict-unknown-key] -typeddicts_extra_items.py:277: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:281: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key] -typeddicts_extra_items.py:282: error: Extra key "language" for TypedDict "ExtraMovie" [typeddict-unknown-key] -typeddicts_extra_items.py:286: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:290: error: Extra key "year" for TypedDict "ClosedMovie" [typeddict-unknown-key] -typeddicts_extra_items.py:296: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key] -typeddicts_extra_items.py:297: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") [assignment] -typeddicts_extra_items.py:299: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] -typeddicts_extra_items.py:300: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int]") [assignment] -typeddicts_extra_items.py:301: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") [assignment] -typeddicts_extra_items.py:307: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" [assert-type] -typeddicts_extra_items.py:308: error: Expression is of type "list[object]", not "list[int | str]" [assert-type] -typeddicts_extra_items.py:316: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] -typeddicts_extra_items.py:323: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") [assignment] -typeddicts_extra_items.py:326: error: Extra key "bar" for TypedDict "IntDictWithNum" [typeddict-unknown-key] -typeddicts_extra_items.py:327: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") [assignment] -typeddicts_extra_items.py:334: error: "IntDictWithNum" has no attribute "clear" [attr-defined] -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] -typeddicts_extra_items.py:339: error: TypedDict key must be a string literal; expected one of ("num") [literal-required] -typeddicts_extra_items.py:340: error: Expected TypedDict key to be string literal [misc] -typeddicts_extra_items.py:349: error: Incompatible types in assignment (expression has type "dict[str, int]", variable has type "IntDict") [assignment] +typeddicts_extra_items.py:251: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:254: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] +typeddicts_extra_items.py:255: error: Extra key "description" for TypedDict "MovieExtraStr" [typeddict-unknown-key] +typeddicts_extra_items.py:266: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] +typeddicts_extra_items.py:278: error: Extra key "year" for TypedDict "NonClosedMovie" [typeddict-unknown-key] +typeddicts_extra_items.py:280: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ExtraMovie" [typeddict-unknown-key] +typeddicts_extra_items.py:285: error: Extra key "language" for TypedDict "ExtraMovie" [typeddict-unknown-key] +typeddicts_extra_items.py:289: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:293: error: Extra key "year" for TypedDict "ClosedMovie" [typeddict-unknown-key] +typeddicts_extra_items.py:299: error: Extra key "summary" for TypedDict "MovieExtraStr" [typeddict-unknown-key] +typeddicts_extra_items.py:300: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") [assignment] +typeddicts_extra_items.py:302: error: Extra key "year" for TypedDict "MovieExtraInt" [typeddict-unknown-key] +typeddicts_extra_items.py:303: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int]") [assignment] +typeddicts_extra_items.py:304: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") [assignment] +typeddicts_extra_items.py:310: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" [assert-type] +typeddicts_extra_items.py:311: error: Expression is of type "list[object]", not "list[int | str]" [assert-type] +typeddicts_extra_items.py:319: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg] +typeddicts_extra_items.py:326: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") [assignment] +typeddicts_extra_items.py:329: error: Extra key "bar" for TypedDict "IntDictWithNum" [typeddict-unknown-key] +typeddicts_extra_items.py:330: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") [assignment] +typeddicts_extra_items.py:337: error: "IntDictWithNum" has no attribute "clear" [attr-defined] +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] +typeddicts_extra_items.py:342: error: TypedDict key must be a string literal; expected one of ("num") [literal-required] +typeddicts_extra_items.py:343: error: Expected TypedDict key to be string literal [misc] +typeddicts_extra_items.py:352: error: Incompatible types in assignment (expression has type "dict[str, int]", variable has type "IntDict") [assignment] """ diff --git a/conformance/results/pyre/typeddicts_extra_items.toml b/conformance/results/pyre/typeddicts_extra_items.toml index a2a8a322..a1f9253c 100644 --- a/conformance/results/pyre/typeddicts_extra_items.toml +++ b/conformance/results/pyre/typeddicts_extra_items.toml @@ -4,17 +4,17 @@ Not supported. """ conformance_automated = "Fail" errors_diff = """ -Line 212: Expected 1 errors -Line 219: Expected 1 errors -Line 239: Expected 1 errors -Line 253: Expected 1 errors -Line 254: Expected 1 errors -Line 265: Expected 1 errors +Line 215: Expected 1 errors +Line 222: Expected 1 errors +Line 242: Expected 1 errors +Line 256: Expected 1 errors +Line 257: Expected 1 errors +Line 268: Expected 1 errors Lines 91, 92: Expected error (tag 'MovieC') Lines 94, 95: Expected error (tag 'MovieD') Lines 184, 185: Expected error (tag 'MovieRequiredYear') Lines 187, 188: Expected error (tag 'MovieNotRequiredYear') -Lines 193, 194: Expected error (tag 'MovieWithDirector') +Lines 196, 197: Expected error (tag 'BookWithPublisher') Line 11: Unexpected errors ['typeddicts_extra_items.py:11:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] Line 14: Unexpected errors ['typeddicts_extra_items.py:14:11 TypedDict initialization error [55]: TypedDict `Movie` has no field `novel_adaptation`.'] Line 21: Unexpected errors ['typeddicts_extra_items.py:21:21 TypedDict initialization error [55]: TypedDict `MovieFunctional` has no field `novel_adaptation`.'] @@ -39,33 +39,34 @@ Line 155: Unexpected errors ['typeddicts_extra_items.py:155:0 Unexpected keyword Line 165: Unexpected errors ['typeddicts_extra_items.py:165:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] Line 171: Unexpected errors ['typeddicts_extra_items.py:171:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] Line 181: Unexpected errors ['typeddicts_extra_items.py:181:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 207: Unexpected errors ['typeddicts_extra_items.py:207:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 214: Unexpected errors ['typeddicts_extra_items.py:214:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 225: Unexpected errors ['typeddicts_extra_items.py:225:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 193: Unexpected errors ['typeddicts_extra_items.py:193:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 210: Unexpected errors ['typeddicts_extra_items.py:210:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 217: Unexpected errors ['typeddicts_extra_items.py:217:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] Line 228: Unexpected errors ['typeddicts_extra_items.py:228:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 232: Unexpected errors ['typeddicts_extra_items.py:232:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 245: Unexpected errors ['typeddicts_extra_items.py:245:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 231: Unexpected errors ['typeddicts_extra_items.py:231:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 235: Unexpected errors ['typeddicts_extra_items.py:235:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] Line 248: Unexpected errors ['typeddicts_extra_items.py:248:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 251: Unexpected errors ['typeddicts_extra_items.py:251:27 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] -Line 252: Unexpected errors ['typeddicts_extra_items.py:252:27 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `description`.'] -Line 263: Unexpected errors ['typeddicts_extra_items.py:263:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] -Line 277: Unexpected errors ['typeddicts_extra_items.py:277:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 281: Unexpected errors ['typeddicts_extra_items.py:281:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ExtraMovie.__init__`.'] -Line 286: Unexpected errors ['typeddicts_extra_items.py:286:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`.'] -Line 296: Unexpected errors ['typeddicts_extra_items.py:296:28 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `summary`.'] -Line 297: Unexpected errors ['typeddicts_extra_items.py:297:0 Incompatible variable type [9]: str_mapping is declared to have type `Mapping[str, str]` but is used as type `MovieExtraStr`.'] -Line 299: Unexpected errors ['typeddicts_extra_items.py:299:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] -Line 301: Unexpected errors ['typeddicts_extra_items.py:301:0 Incompatible variable type [9]: int_str_mapping is declared to have type `Mapping[str, Union[int, str]]` but is used as type `MovieExtraInt`.'] -Line 307: Unexpected errors ['typeddicts_extra_items.py:307:4 Assert type [70]: Expected `List[Tuple[str, Union[int, str]]]` but got `List[Tuple[str, object]]`.'] -Line 308: Unexpected errors ['typeddicts_extra_items.py:308:4 Assert type [70]: Expected `List[Union[int, str]]` but got `List[object]`.'] -Line 316: Unexpected errors ['typeddicts_extra_items.py:316:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] -Line 323: Unexpected errors ['typeddicts_extra_items.py:323:4 Incompatible variable type [9]: v is declared to have type `Dict[str, int]` but is used as type `IntDict`.'] -Line 326: Unexpected errors ['typeddicts_extra_items.py:326:40 TypedDict initialization error [55]: TypedDict `IntDictWithNum` has no field `bar`.'] -Line 327: Unexpected errors ['typeddicts_extra_items.py:327:0 Incompatible variable type [9]: regular_dict is declared to have type `Dict[str, int]` but is used as type `IntDictWithNum`.'] -Line 334: Unexpected errors ['typeddicts_extra_items.py:334:0 Undefined attribute [16]: `IntDictWithNum` has no attribute `clear`.'] -Line 336: Unexpected errors ['typeddicts_extra_items.py:336:0 Assert type [70]: Expected `Tuple[str, int]` but got `typing.Any`.', 'typeddicts_extra_items.py:336:12 Undefined attribute [16]: `IntDictWithNum` has no attribute `popitem`.'] -Line 339: Unexpected errors ["typeddicts_extra_items.py:339:26 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num')."] -Line 340: Unexpected errors ["typeddicts_extra_items.py:340:30 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num')."] +Line 251: Unexpected errors ['typeddicts_extra_items.py:251:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 254: Unexpected errors ['typeddicts_extra_items.py:254:27 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] +Line 255: Unexpected errors ['typeddicts_extra_items.py:255:27 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `description`.'] +Line 266: Unexpected errors ['typeddicts_extra_items.py:266:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] +Line 280: Unexpected errors ['typeddicts_extra_items.py:280:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 284: Unexpected errors ['typeddicts_extra_items.py:284:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ExtraMovie.__init__`.'] +Line 289: Unexpected errors ['typeddicts_extra_items.py:289:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`.'] +Line 299: Unexpected errors ['typeddicts_extra_items.py:299:28 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `summary`.'] +Line 300: Unexpected errors ['typeddicts_extra_items.py:300:0 Incompatible variable type [9]: str_mapping is declared to have type `Mapping[str, str]` but is used as type `MovieExtraStr`.'] +Line 302: Unexpected errors ['typeddicts_extra_items.py:302:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`.'] +Line 304: Unexpected errors ['typeddicts_extra_items.py:304:0 Incompatible variable type [9]: int_str_mapping is declared to have type `Mapping[str, Union[int, str]]` but is used as type `MovieExtraInt`.'] +Line 310: Unexpected errors ['typeddicts_extra_items.py:310:4 Assert type [70]: Expected `List[Tuple[str, Union[int, str]]]` but got `List[Tuple[str, object]]`.'] +Line 311: Unexpected errors ['typeddicts_extra_items.py:311:4 Assert type [70]: Expected `List[Union[int, str]]` but got `List[object]`.'] +Line 319: Unexpected errors ['typeddicts_extra_items.py:319:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`.'] +Line 326: Unexpected errors ['typeddicts_extra_items.py:326:4 Incompatible variable type [9]: v is declared to have type `Dict[str, int]` but is used as type `IntDict`.'] +Line 329: Unexpected errors ['typeddicts_extra_items.py:329:40 TypedDict initialization error [55]: TypedDict `IntDictWithNum` has no field `bar`.'] +Line 330: Unexpected errors ['typeddicts_extra_items.py:330:0 Incompatible variable type [9]: regular_dict is declared to have type `Dict[str, int]` but is used as type `IntDictWithNum`.'] +Line 337: Unexpected errors ['typeddicts_extra_items.py:337:0 Undefined attribute [16]: `IntDictWithNum` has no attribute `clear`.'] +Line 339: Unexpected errors ['typeddicts_extra_items.py:339:0 Assert type [70]: Expected `Tuple[str, int]` but got `typing.Any`.', 'typeddicts_extra_items.py:339:12 Undefined attribute [16]: `IntDictWithNum` has no attribute `popitem`.'] +Line 342: Unexpected errors ["typeddicts_extra_items.py:342:26 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num')."] +Line 343: Unexpected errors ["typeddicts_extra_items.py:343:30 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num')."] """ output = """ typeddicts_extra_items.py:11:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. @@ -105,37 +106,38 @@ typeddicts_extra_items.py:165:0 Unexpected keyword [28]: Unexpected keyword argu typeddicts_extra_items.py:171:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. typeddicts_extra_items.py:174:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. typeddicts_extra_items.py:181:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:207:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:214:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:225:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:193:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:210:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:217:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. typeddicts_extra_items.py:228:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:232:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:245:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:231:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:235:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. typeddicts_extra_items.py:248:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:251:27 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. -typeddicts_extra_items.py:252:27 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `description`. -typeddicts_extra_items.py:263:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. -typeddicts_extra_items.py:275:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `NonClosedMovie.__init__`. -typeddicts_extra_items.py:277:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:281:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ExtraMovie.__init__`. -typeddicts_extra_items.py:282:0 Unexpected keyword [28]: Unexpected keyword argument `language` to call `ExtraMovie.__init__`. -typeddicts_extra_items.py:286:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. -typeddicts_extra_items.py:290:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ClosedMovie.__init__`. -typeddicts_extra_items.py:296:28 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `summary`. -typeddicts_extra_items.py:297:0 Incompatible variable type [9]: str_mapping is declared to have type `Mapping[str, str]` but is used as type `MovieExtraStr`. -typeddicts_extra_items.py:299:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. -typeddicts_extra_items.py:300:0 Incompatible variable type [9]: int_mapping is declared to have type `Mapping[str, int]` but is used as type `MovieExtraInt`. -typeddicts_extra_items.py:301:0 Incompatible variable type [9]: int_str_mapping is declared to have type `Mapping[str, Union[int, str]]` but is used as type `MovieExtraInt`. -typeddicts_extra_items.py:307:4 Assert type [70]: Expected `List[Tuple[str, Union[int, str]]]` but got `List[Tuple[str, object]]`. -typeddicts_extra_items.py:308:4 Assert type [70]: Expected `List[Union[int, str]]` but got `List[object]`. -typeddicts_extra_items.py:316:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. -typeddicts_extra_items.py:323:4 Incompatible variable type [9]: v is declared to have type `Dict[str, int]` but is used as type `IntDict`. -typeddicts_extra_items.py:326:40 TypedDict initialization error [55]: TypedDict `IntDictWithNum` has no field `bar`. -typeddicts_extra_items.py:327:0 Incompatible variable type [9]: regular_dict is declared to have type `Dict[str, int]` but is used as type `IntDictWithNum`. -typeddicts_extra_items.py:334:0 Undefined attribute [16]: `IntDictWithNum` has no attribute `clear`. -typeddicts_extra_items.py:336:0 Assert type [70]: Expected `Tuple[str, int]` but got `typing.Any`. -typeddicts_extra_items.py:336:12 Undefined attribute [16]: `IntDictWithNum` has no attribute `popitem`. -typeddicts_extra_items.py:339:26 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num'). -typeddicts_extra_items.py:340:30 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num'). -typeddicts_extra_items.py:349:4 Incompatible variable type [9]: int_dict is declared to have type `IntDict` but is used as type `Dict[str, int]`. +typeddicts_extra_items.py:251:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:254:27 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. +typeddicts_extra_items.py:255:27 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `description`. +typeddicts_extra_items.py:266:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. +typeddicts_extra_items.py:278:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `NonClosedMovie.__init__`. +typeddicts_extra_items.py:280:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:284:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ExtraMovie.__init__`. +typeddicts_extra_items.py:285:0 Unexpected keyword [28]: Unexpected keyword argument `language` to call `ExtraMovie.__init__`. +typeddicts_extra_items.py:289:0 Unexpected keyword [28]: Unexpected keyword argument `closed` to call `object.__init_subclass__`. +typeddicts_extra_items.py:293:0 Unexpected keyword [28]: Unexpected keyword argument `year` to call `ClosedMovie.__init__`. +typeddicts_extra_items.py:299:28 TypedDict initialization error [55]: TypedDict `MovieExtraStr` has no field `summary`. +typeddicts_extra_items.py:300:0 Incompatible variable type [9]: str_mapping is declared to have type `Mapping[str, str]` but is used as type `MovieExtraStr`. +typeddicts_extra_items.py:302:28 TypedDict initialization error [55]: TypedDict `MovieExtraInt` has no field `year`. +typeddicts_extra_items.py:303:0 Incompatible variable type [9]: int_mapping is declared to have type `Mapping[str, int]` but is used as type `MovieExtraInt`. +typeddicts_extra_items.py:304:0 Incompatible variable type [9]: int_str_mapping is declared to have type `Mapping[str, Union[int, str]]` but is used as type `MovieExtraInt`. +typeddicts_extra_items.py:310:4 Assert type [70]: Expected `List[Tuple[str, Union[int, str]]]` but got `List[Tuple[str, object]]`. +typeddicts_extra_items.py:311:4 Assert type [70]: Expected `List[Union[int, str]]` but got `List[object]`. +typeddicts_extra_items.py:319:0 Unexpected keyword [28]: Unexpected keyword argument `extra_items` to call `object.__init_subclass__`. +typeddicts_extra_items.py:326:4 Incompatible variable type [9]: v is declared to have type `Dict[str, int]` but is used as type `IntDict`. +typeddicts_extra_items.py:329:40 TypedDict initialization error [55]: TypedDict `IntDictWithNum` has no field `bar`. +typeddicts_extra_items.py:330:0 Incompatible variable type [9]: regular_dict is declared to have type `Dict[str, int]` but is used as type `IntDictWithNum`. +typeddicts_extra_items.py:337:0 Undefined attribute [16]: `IntDictWithNum` has no attribute `clear`. +typeddicts_extra_items.py:339:0 Assert type [70]: Expected `Tuple[str, int]` but got `typing.Any`. +typeddicts_extra_items.py:339:12 Undefined attribute [16]: `IntDictWithNum` has no attribute `popitem`. +typeddicts_extra_items.py:342:26 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num'). +typeddicts_extra_items.py:343:30 TypedDict accessed with a non-literal [26]: TypedDict key must be a string literal. Expected one of ('num'). +typeddicts_extra_items.py:352:4 Incompatible variable type [9]: int_dict is declared to have type `IntDict` but is used as type `Dict[str, int]`. """ diff --git a/conformance/results/pyright/typeddicts_extra_items.toml b/conformance/results/pyright/typeddicts_extra_items.toml index d288332c..d54c48d9 100644 --- a/conformance/results/pyright/typeddicts_extra_items.toml +++ b/conformance/results/pyright/typeddicts_extra_items.toml @@ -32,39 +32,39 @@ typeddicts_extra_items.py:184:7 - error: Base class "MovieBase2" is a TypedDict   Cannot add item "year" because it must be NotRequired (reportIncompatibleVariableOverride) typeddicts_extra_items.py:187:7 - error: Base class "MovieBase2" is a TypedDict that limits the type of extra items to type "int | None"   Cannot add item "year" with type "int" (reportIncompatibleVariableOverride) -typeddicts_extra_items.py:193:7 - error: Base class "MovieBase" is a TypedDict that limits the type of extra items to type "int | None" -  Cannot add item "director" with type "str" (reportIncompatibleVariableOverride) -typeddicts_extra_items.py:212:22 - error: Type "MovieDetails" is not assignable to declared type "MovieBase2" +typeddicts_extra_items.py:196:7 - error: Base class "BookBase" is a TypedDict that limits the type of extra items to type "int | None" +  Cannot add item "publisher" with type "str" (reportIncompatibleVariableOverride) +typeddicts_extra_items.py:215:22 - error: Type "MovieDetails" is not assignable to declared type "MovieBase2"   Type of "year" is incompatible with type of "extra_items" in "MovieBase2"     Type "int" is not assignable to type "int | None"       "int" is not assignable to "None" (reportAssignmentType) -typeddicts_extra_items.py:219:22 - error: Type "MovieWithYear2" is not assignable to declared type "MovieBase2" +typeddicts_extra_items.py:222:22 - error: Type "MovieWithYear2" is not assignable to declared type "MovieBase2"   "year" is not required in "MovieBase2" (reportAssignmentType) -typeddicts_extra_items.py:239:19 - error: Type "MovieDetails5" is not assignable to declared type "MovieSI" +typeddicts_extra_items.py:242:19 - error: Type "MovieDetails5" is not assignable to declared type "MovieSI"   Type of "actors" is incompatible with type of "extra_items" in "MovieSI"     Type "list[str]" is not assignable to type "str | int"       "list[str]" is not assignable to "str"       "list[str]" is not assignable to "int" (reportAssignmentType) -typeddicts_extra_items.py:253:13 - error: Type "MovieExtraStr" is not assignable to declared type "MovieExtraInt" +typeddicts_extra_items.py:256:13 - error: Type "MovieExtraStr" is not assignable to declared type "MovieExtraInt"   Type of "extra_items" is incompatible with type of "extra_items" in "MovieExtraStr"     "str" is not assignable to "int" (reportAssignmentType) -typeddicts_extra_items.py:254:13 - error: Type "MovieExtraInt" is not assignable to declared type "MovieExtraStr" +typeddicts_extra_items.py:257:13 - error: Type "MovieExtraInt" is not assignable to declared type "MovieExtraStr"   Type of "extra_items" is incompatible with type of "extra_items" in "MovieExtraInt"     "int" is not assignable to "str" (reportAssignmentType) -typeddicts_extra_items.py:265:14 - error: Type "MovieNotClosed" is not assignable to declared type "MovieExtraInt" +typeddicts_extra_items.py:268:14 - error: Type "MovieNotClosed" is not assignable to declared type "MovieExtraInt"   Type of "extra_items" is incompatible with type of "extra_items" in "MovieNotClosed"     "object" is not assignable to "int" (reportAssignmentType) -typeddicts_extra_items.py:275:1 - error: No overloads for "__init__" match the provided arguments +typeddicts_extra_items.py:278:1 - error: No overloads for "__init__" match the provided arguments   Argument types: (Literal['No Country for Old Men'], Literal[2007]) (reportCallIssue) -typeddicts_extra_items.py:282:52 - error: Argument of type "Literal['English']" cannot be assigned to parameter "language" of type "int" in function "__init__" +typeddicts_extra_items.py:285:52 - error: Argument of type "Literal['English']" cannot be assigned to parameter "language" of type "int" in function "__init__"   "Literal['English']" is not assignable to "int" (reportArgumentType) -typeddicts_extra_items.py:290:1 - error: No overloads for "__init__" match the provided arguments +typeddicts_extra_items.py:293:1 - error: No overloads for "__init__" match the provided arguments   Argument types: (Literal['No Country for Old Men'], Literal[2007]) (reportCallIssue) -typeddicts_extra_items.py:300:34 - error: Type "MovieExtraInt" is not assignable to declared type "Mapping[str, int]" +typeddicts_extra_items.py:303:34 - error: Type "MovieExtraInt" is not assignable to declared type "Mapping[str, int]"   "Mapping[str, str | int]" is not assignable to "Mapping[str, int]"     Type parameter "_VT_co@Mapping" is covariant, but "str | int" is not a subtype of "int"       Type "str | int" is not assignable to type "int"         "str" is not assignable to "int" (reportAssignmentType) -typeddicts_extra_items.py:349:25 - error: Type "dict[str, int]" is not assignable to declared type "IntDict" +typeddicts_extra_items.py:352:25 - error: Type "dict[str, int]" is not assignable to declared type "IntDict"   "dict[str, int]" is not assignable to "IntDict" (reportAssignmentType) """ diff --git a/conformance/results/zuban/typeddicts_extra_items.toml b/conformance/results/zuban/typeddicts_extra_items.toml index 68e73434..b5840403 100644 --- a/conformance/results/zuban/typeddicts_extra_items.toml +++ b/conformance/results/zuban/typeddicts_extra_items.toml @@ -5,17 +5,17 @@ Not supported. conformance_automated = "Fail" errors_diff = """ Line 22: Expected 1 errors -Line 212: Expected 1 errors -Line 219: Expected 1 errors -Line 239: Expected 1 errors -Line 253: Expected 1 errors -Line 254: Expected 1 errors -Line 265: Expected 1 errors +Line 215: Expected 1 errors +Line 222: Expected 1 errors +Line 242: Expected 1 errors +Line 256: Expected 1 errors +Line 257: Expected 1 errors +Line 268: Expected 1 errors Lines 91, 92: Expected error (tag 'MovieC') Lines 94, 95: Expected error (tag 'MovieD') Lines 184, 185: Expected error (tag 'MovieRequiredYear') Lines 187, 188: Expected error (tag 'MovieNotRequiredYear') -Lines 193, 194: Expected error (tag 'MovieWithDirector') +Lines 196, 197: Expected error (tag 'BookWithPublisher') Line 11: Unexpected errors ['typeddicts_extra_items.py:11: error: Unexpected keyword argument "extra_items" for TypedDict'] Line 14: Unexpected errors ['typeddicts_extra_items.py:14: error: Extra key "novel_adaptation" for TypedDict "Movie"'] Line 19: Unexpected errors ['typeddicts_extra_items.py:19: error: Unexpected keyword argument "extra_items" for "TypedDict"'] @@ -40,33 +40,34 @@ Line 155: Unexpected errors ['typeddicts_extra_items.py:155: error: Unexpected k Line 165: Unexpected errors ['typeddicts_extra_items.py:165: error: Unexpected keyword argument "extra_items" for TypedDict'] Line 171: Unexpected errors ['typeddicts_extra_items.py:171: error: Unexpected keyword argument "extra_items" for TypedDict'] Line 181: Unexpected errors ['typeddicts_extra_items.py:181: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 207: Unexpected errors ['typeddicts_extra_items.py:207: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 214: Unexpected errors ['typeddicts_extra_items.py:214: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 225: Unexpected errors ['typeddicts_extra_items.py:225: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 193: Unexpected errors ['typeddicts_extra_items.py:193: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 210: Unexpected errors ['typeddicts_extra_items.py:210: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 217: Unexpected errors ['typeddicts_extra_items.py:217: error: Unexpected keyword argument "extra_items" for TypedDict'] Line 228: Unexpected errors ['typeddicts_extra_items.py:228: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 232: Unexpected errors ['typeddicts_extra_items.py:232: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 245: Unexpected errors ['typeddicts_extra_items.py:245: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 231: Unexpected errors ['typeddicts_extra_items.py:231: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 235: Unexpected errors ['typeddicts_extra_items.py:235: error: Unexpected keyword argument "extra_items" for TypedDict'] Line 248: Unexpected errors ['typeddicts_extra_items.py:248: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 251: Unexpected errors ['typeddicts_extra_items.py:251: error: Extra key "year" for TypedDict "MovieExtraInt"'] -Line 252: Unexpected errors ['typeddicts_extra_items.py:252: error: Extra key "description" for TypedDict "MovieExtraStr"'] -Line 263: Unexpected errors ['typeddicts_extra_items.py:263: error: Extra key "year" for TypedDict "MovieExtraInt"'] -Line 277: Unexpected errors ['typeddicts_extra_items.py:277: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 281: Unexpected errors ['typeddicts_extra_items.py:281: error: Extra key "year" for TypedDict "ExtraMovie"'] -Line 286: Unexpected errors ['typeddicts_extra_items.py:286: error: Unexpected keyword argument "closed" for TypedDict'] -Line 296: Unexpected errors ['typeddicts_extra_items.py:296: error: Extra key "summary" for TypedDict "MovieExtraStr"'] -Line 297: Unexpected errors ['typeddicts_extra_items.py:297: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]")'] -Line 299: Unexpected errors ['typeddicts_extra_items.py:299: error: Extra key "year" for TypedDict "MovieExtraInt"'] -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]")'] -Line 307: Unexpected errors ['typeddicts_extra_items.py:307: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]"'] -Line 308: Unexpected errors ['typeddicts_extra_items.py:308: error: Expression is of type "list[object]", not "list[int | str]"'] -Line 316: Unexpected errors ['typeddicts_extra_items.py:316: error: Unexpected keyword argument "extra_items" for TypedDict'] -Line 323: Unexpected errors ['typeddicts_extra_items.py:323: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]")'] -Line 326: Unexpected errors ['typeddicts_extra_items.py:326: error: Extra key "bar" for TypedDict "IntDictWithNum"'] -Line 327: Unexpected errors ['typeddicts_extra_items.py:327: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]")'] -Line 334: Unexpected errors ['typeddicts_extra_items.py:334: error: "IntDictWithNum" has no attribute "clear"'] -Line 336: Unexpected errors ['typeddicts_extra_items.py:336: error: Expression is of type "Any", not "tuple[str, int]"', 'typeddicts_extra_items.py:336: error: "IntDictWithNum" has no attribute "popitem"'] -Line 339: Unexpected errors ['typeddicts_extra_items.py:339: error: TypedDict key must be a string literal; expected one of ("num")'] -Line 340: Unexpected errors ['typeddicts_extra_items.py:340: error: Expected TypedDict key to be string literal'] +Line 251: Unexpected errors ['typeddicts_extra_items.py:251: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 254: Unexpected errors ['typeddicts_extra_items.py:254: error: Extra key "year" for TypedDict "MovieExtraInt"'] +Line 255: Unexpected errors ['typeddicts_extra_items.py:255: error: Extra key "description" for TypedDict "MovieExtraStr"'] +Line 266: Unexpected errors ['typeddicts_extra_items.py:266: error: Extra key "year" for TypedDict "MovieExtraInt"'] +Line 280: Unexpected errors ['typeddicts_extra_items.py:280: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 284: Unexpected errors ['typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ExtraMovie"'] +Line 289: Unexpected errors ['typeddicts_extra_items.py:289: error: Unexpected keyword argument "closed" for TypedDict'] +Line 299: Unexpected errors ['typeddicts_extra_items.py:299: error: Extra key "summary" for TypedDict "MovieExtraStr"'] +Line 300: Unexpected errors ['typeddicts_extra_items.py:300: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]")'] +Line 302: Unexpected errors ['typeddicts_extra_items.py:302: error: Extra key "year" for TypedDict "MovieExtraInt"'] +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]")'] +Line 310: Unexpected errors ['typeddicts_extra_items.py:310: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]"'] +Line 311: Unexpected errors ['typeddicts_extra_items.py:311: error: Expression is of type "list[object]", not "list[int | str]"'] +Line 319: Unexpected errors ['typeddicts_extra_items.py:319: error: Unexpected keyword argument "extra_items" for TypedDict'] +Line 326: Unexpected errors ['typeddicts_extra_items.py:326: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]")'] +Line 329: Unexpected errors ['typeddicts_extra_items.py:329: error: Extra key "bar" for TypedDict "IntDictWithNum"'] +Line 330: Unexpected errors ['typeddicts_extra_items.py:330: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]")'] +Line 337: Unexpected errors ['typeddicts_extra_items.py:337: error: "IntDictWithNum" has no attribute "clear"'] +Line 339: Unexpected errors ['typeddicts_extra_items.py:339: error: Expression is of type "Any", not "tuple[str, int]"', 'typeddicts_extra_items.py:339: error: "IntDictWithNum" has no attribute "popitem"'] +Line 342: Unexpected errors ['typeddicts_extra_items.py:342: error: TypedDict key must be a string literal; expected one of ("num")'] +Line 343: Unexpected errors ['typeddicts_extra_items.py:343: error: Expected TypedDict key to be string literal'] """ output = """ typeddicts_extra_items.py:11: error: Unexpected keyword argument "extra_items" for TypedDict @@ -105,37 +106,38 @@ typeddicts_extra_items.py:165: error: Unexpected keyword argument "extra_items" typeddicts_extra_items.py:171: error: Unexpected keyword argument "extra_items" for TypedDict typeddicts_extra_items.py:174: error: Unexpected keyword argument "extra_items" for TypedDict typeddicts_extra_items.py:181: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:207: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:214: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:225: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:193: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:210: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:217: error: Unexpected keyword argument "extra_items" for TypedDict typeddicts_extra_items.py:228: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:232: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:245: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:231: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:235: error: Unexpected keyword argument "extra_items" for TypedDict typeddicts_extra_items.py:248: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:251: error: Extra key "year" for TypedDict "MovieExtraInt" -typeddicts_extra_items.py:252: error: Extra key "description" for TypedDict "MovieExtraStr" -typeddicts_extra_items.py:263: error: Extra key "year" for TypedDict "MovieExtraInt" -typeddicts_extra_items.py:275: error: Extra key "year" for TypedDict "NonClosedMovie" -typeddicts_extra_items.py:277: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:281: error: Extra key "year" for TypedDict "ExtraMovie" -typeddicts_extra_items.py:282: error: Extra key "language" for TypedDict "ExtraMovie" -typeddicts_extra_items.py:286: error: Unexpected keyword argument "closed" for TypedDict -typeddicts_extra_items.py:290: error: Extra key "year" for TypedDict "ClosedMovie" -typeddicts_extra_items.py:296: error: Extra key "summary" for TypedDict "MovieExtraStr" -typeddicts_extra_items.py:297: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") -typeddicts_extra_items.py:299: error: Extra key "year" for TypedDict "MovieExtraInt" -typeddicts_extra_items.py:300: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int]") -typeddicts_extra_items.py:301: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") -typeddicts_extra_items.py:307: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" -typeddicts_extra_items.py:308: error: Expression is of type "list[object]", not "list[int | str]" -typeddicts_extra_items.py:316: error: Unexpected keyword argument "extra_items" for TypedDict -typeddicts_extra_items.py:323: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") -typeddicts_extra_items.py:326: error: Extra key "bar" for TypedDict "IntDictWithNum" -typeddicts_extra_items.py:327: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") -typeddicts_extra_items.py:334: error: "IntDictWithNum" has no attribute "clear" -typeddicts_extra_items.py:336: error: Expression is of type "Any", not "tuple[str, int]" -typeddicts_extra_items.py:336: error: "IntDictWithNum" has no attribute "popitem" -typeddicts_extra_items.py:339: error: TypedDict key must be a string literal; expected one of ("num") -typeddicts_extra_items.py:340: error: Expected TypedDict key to be string literal -typeddicts_extra_items.py:349: error: Incompatible types in assignment (expression has type "dict[str, int]", variable has type "IntDict") +typeddicts_extra_items.py:251: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:254: error: Extra key "year" for TypedDict "MovieExtraInt" +typeddicts_extra_items.py:255: error: Extra key "description" for TypedDict "MovieExtraStr" +typeddicts_extra_items.py:266: error: Extra key "year" for TypedDict "MovieExtraInt" +typeddicts_extra_items.py:278: error: Extra key "year" for TypedDict "NonClosedMovie" +typeddicts_extra_items.py:280: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:284: error: Extra key "year" for TypedDict "ExtraMovie" +typeddicts_extra_items.py:285: error: Extra key "language" for TypedDict "ExtraMovie" +typeddicts_extra_items.py:289: error: Unexpected keyword argument "closed" for TypedDict +typeddicts_extra_items.py:293: error: Extra key "year" for TypedDict "ClosedMovie" +typeddicts_extra_items.py:299: error: Extra key "summary" for TypedDict "MovieExtraStr" +typeddicts_extra_items.py:300: error: Incompatible types in assignment (expression has type "MovieExtraStr", variable has type "Mapping[str, str]") +typeddicts_extra_items.py:302: error: Extra key "year" for TypedDict "MovieExtraInt" +typeddicts_extra_items.py:303: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int]") +typeddicts_extra_items.py:304: error: Incompatible types in assignment (expression has type "MovieExtraInt", variable has type "Mapping[str, int | str]") +typeddicts_extra_items.py:310: error: Expression is of type "list[tuple[str, object]]", not "list[tuple[str, int | str]]" +typeddicts_extra_items.py:311: error: Expression is of type "list[object]", not "list[int | str]" +typeddicts_extra_items.py:319: error: Unexpected keyword argument "extra_items" for TypedDict +typeddicts_extra_items.py:326: error: Incompatible types in assignment (expression has type "IntDict", variable has type "dict[str, int]") +typeddicts_extra_items.py:329: error: Extra key "bar" for TypedDict "IntDictWithNum" +typeddicts_extra_items.py:330: error: Incompatible types in assignment (expression has type "IntDictWithNum", variable has type "dict[str, int]") +typeddicts_extra_items.py:337: error: "IntDictWithNum" has no attribute "clear" +typeddicts_extra_items.py:339: error: Expression is of type "Any", not "tuple[str, int]" +typeddicts_extra_items.py:339: error: "IntDictWithNum" has no attribute "popitem" +typeddicts_extra_items.py:342: error: TypedDict key must be a string literal; expected one of ("num") +typeddicts_extra_items.py:343: error: Expected TypedDict key to be string literal +typeddicts_extra_items.py:352: error: Incompatible types in assignment (expression has type "dict[str, int]", variable has type "IntDict") """ diff --git a/conformance/tests/typeddicts_extra_items.py b/conformance/tests/typeddicts_extra_items.py index 4a7fe104..b8a9c53f 100644 --- a/conformance/tests/typeddicts_extra_items.py +++ b/conformance/tests/typeddicts_extra_items.py @@ -187,11 +187,14 @@ class MovieRequiredYear(MovieBase2): # E[MovieRequiredYear]: Required key 'year class MovieNotRequiredYear(MovieBase2): # E[MovieNotRequiredYear]: 'int | None' is not consistent with 'int' year: NotRequired[int] # E[MovieNotRequiredYear] -class MovieWithYear(MovieBase): # OK +class MovieWithYear(MovieBase2): # OK year: NotRequired[int | None] -class MovieWithDirector(MovieBase): # E[MovieWithDirector]: 'str' is not assignable to 'int | None' - director: str # E[MovieWithDirector] +class BookBase(TypedDict, extra_items=ReadOnly[int | None]): + name: str + +class BookWithPublisher(BookBase): # E[BookWithPublisher]: 'str' is not assignable to 'int | None' + publisher: str # E[BookWithPublisher] # > Let ``S`` be the set of keys of the explicitly defined items on a TypedDict # > type. If it specifies ``extra_items=T``, the TypedDict type is considered to