@@ -5740,8 +5740,8 @@ import b
5740
5740
b.xyz
5741
5741
5742
5742
[file b.py]
5743
- from typing import NamedTuple, NewType
5744
- from typing_extensions import TypedDict, TypeAlias
5743
+ from typing import NamedTuple, NewType, TypedDict
5744
+ from typing_extensions import TypeAlias
5745
5745
from enum import Enum
5746
5746
from dataclasses import dataclass
5747
5747
@@ -5777,6 +5777,7 @@ class C:
5777
5777
n: N = N(NT1(c=1))
5778
5778
5779
5779
[builtins fixtures/dict.pyi]
5780
+ [typing fixtures/typing-typeddict.pyi]
5780
5781
[out2]
5781
5782
tmp/a.py:2: error: "object" has no attribute "xyz"
5782
5783
@@ -6079,7 +6080,8 @@ tmp/b.py:3: error: Incompatible types in assignment (expression has type "int",
6079
6080
[case testUnpackKwargsSerialize]
6080
6081
import m
6081
6082
[file lib.py]
6082
- from typing_extensions import Unpack, TypedDict
6083
+ from typing import TypedDict
6084
+ from typing_extensions import Unpack
6083
6085
6084
6086
class Person(TypedDict):
6085
6087
name: str
@@ -6095,6 +6097,7 @@ foo(name='Jennifer', age=38)
6095
6097
from lib import foo
6096
6098
foo(name='Jennifer', age="38")
6097
6099
[builtins fixtures/dict.pyi]
6100
+ [typing fixtures/typing-typeddict.pyi]
6098
6101
[out]
6099
6102
[out2]
6100
6103
tmp/m.py:2: error: Argument "age" to "foo" has incompatible type "str"; expected "int"
@@ -6276,7 +6279,7 @@ import f
6276
6279
# modify
6277
6280
6278
6281
[file f.py]
6279
- from typing_extensions import TypedDict
6282
+ from typing import TypedDict
6280
6283
import c
6281
6284
class D(TypedDict):
6282
6285
x: c.C
@@ -6297,6 +6300,7 @@ class C: ...
6297
6300
class C: ...
6298
6301
[file pb1.py.2]
6299
6302
[builtins fixtures/dict.pyi]
6303
+ [typing fixtures/typing-typeddict.pyi]
6300
6304
[out]
6301
6305
[out2]
6302
6306
[out3]
@@ -6464,8 +6468,7 @@ y: int = x
6464
6468
[case testGenericTypedDictWithError]
6465
6469
import b
6466
6470
[file a.py]
6467
- from typing import Generic, TypeVar
6468
- from typing_extensions import TypedDict
6471
+ from typing import Generic, TypeVar, TypedDict
6469
6472
6470
6473
TValue = TypeVar("TValue")
6471
6474
class Dict(TypedDict, Generic[TValue]):
@@ -6487,6 +6490,7 @@ def f(d: Dict[TValue]) -> TValue:
6487
6490
def g(d: Dict[TValue]) -> TValue:
6488
6491
return d["y"]
6489
6492
[builtins fixtures/dict.pyi]
6493
+ [typing fixtures/typing-typeddict.pyi]
6490
6494
[out]
6491
6495
tmp/b.py:6: error: TypedDict "a.Dict[TValue]" has no key "x"
6492
6496
[out2]
@@ -6588,9 +6592,10 @@ import counts
6588
6592
import counts
6589
6593
# touch
6590
6594
[file counts.py]
6591
- from typing_extensions import TypedDict
6595
+ from typing import TypedDict
6592
6596
Counts = TypedDict("Counts", {k: int for k in "abc"}) # type: ignore
6593
6597
[builtins fixtures/dict.pyi]
6598
+ [typing fixtures/typing-typeddict.pyi]
6594
6599
6595
6600
[case testNoIncrementalCrashOnInvalidTypedDictFunc]
6596
6601
import m
@@ -6600,10 +6605,11 @@ import counts
6600
6605
import counts
6601
6606
# touch
6602
6607
[file counts.py]
6603
- from typing_extensions import TypedDict
6608
+ from typing import TypedDict
6604
6609
def test() -> None:
6605
6610
Counts = TypedDict("Counts", {k: int for k in "abc"}) # type: ignore
6606
6611
[builtins fixtures/dict.pyi]
6612
+ [typing fixtures/typing-typeddict.pyi]
6607
6613
6608
6614
[case testNoIncrementalCrashOnTypedDictMethod]
6609
6615
import a
@@ -6615,13 +6621,14 @@ from b import C
6615
6621
x: C
6616
6622
reveal_type(x.h)
6617
6623
[file b.py]
6618
- from typing_extensions import TypedDict
6624
+ from typing import TypedDict
6619
6625
class C:
6620
6626
def __init__(self) -> None:
6621
6627
self.h: Hidden
6622
6628
class Hidden(TypedDict):
6623
6629
x: int
6624
6630
[builtins fixtures/dict.pyi]
6631
+ [typing fixtures/typing-typeddict.pyi]
6625
6632
[out]
6626
6633
[out2]
6627
6634
tmp/a.py:3: note: Revealed type is "TypedDict('b.C.Hidden@5', {'x': builtins.int})"
0 commit comments