We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1cfb130 commit 57db925Copy full SHA for 57db925
test-data/unit/check-typeddict.test
@@ -4297,9 +4297,13 @@ class TD(TypedDict):
4297
x: int
4298
4299
x: Union[TD, dict[str, str]] = {"x": "foo"}
4300
+y: Union[TD, dict[str, int]] = {"x": "foo"} # E: Dict entry 0 has incompatible type "str": "str"; expected "str": "int"
4301
-def accepts_td(d: Union[TD, dict[str, str]]) -> None: ...
4302
+def ok(d: Union[TD, dict[str, str]]) -> None: ...
4303
+ok({"x": "foo"})
4304
+
4305
+def bad(d: Union[TD, dict[str, int]]) -> None: ...
4306
+bad({"x": "foo"}) # E: Dict entry 0 has incompatible type "str": "str"; expected "str": "int"
4307
-accepts_td({"x": "foo"})
4308
[builtins fixtures/dict.pyi]
4309
[typing fixtures/typing-typeddict.pyi]
0 commit comments