@@ -5,8 +5,8 @@ from typing import TypedDict
55Point = TypedDict('Point', {'x': int, 'y': int})
66p = Point(x=42, y=1337)
77reveal_type(p) # N: Revealed type is "TypedDict('__main__.Point', {'x': builtins.int, 'y': builtins.int})"
8- # Use values() to check fallback value type.
9- reveal_type(p.values ()) # N: Revealed type is "typing.Iterable[builtins.object ]"
8+ reveal_type(p. values()) # N: Revealed type is "typing.ValuesView[builtins.int]"
9+ reveal_type(p.keys ()) # N: Revealed type is "typing.KeysView[Union[Literal['x'], Literal['y']] ]"
1010[builtins fixtures/dict.pyi]
1111[typing fixtures/typing-typeddict.pyi]
1212[targets __main__]
@@ -16,8 +16,8 @@ from typing import TypedDict
1616Point = TypedDict('Point', {'x': int, 'y': int})
1717p = Point(dict(x=42, y=1337))
1818reveal_type(p) # N: Revealed type is "TypedDict('__main__.Point', {'x': builtins.int, 'y': builtins.int})"
19- # Use values() to check fallback value type.
20- reveal_type(p.values ()) # N: Revealed type is "typing.Iterable[builtins.object ]"
19+ reveal_type(p. values()) # N: Revealed type is "typing.ValuesView[builtins.int]"
20+ reveal_type(p.keys ()) # N: Revealed type is "typing.KeysView[Union[Literal['x'], Literal['y']] ]"
2121[builtins fixtures/dict.pyi]
2222[typing fixtures/typing-typeddict.pyi]
2323
@@ -26,8 +26,8 @@ from typing import TypedDict
2626Point = TypedDict('Point', {'x': int, 'y': int})
2727p = Point({'x': 42, 'y': 1337})
2828reveal_type(p) # N: Revealed type is "TypedDict('__main__.Point', {'x': builtins.int, 'y': builtins.int})"
29- # Use values() to check fallback value type.
30- reveal_type(p.values ()) # N: Revealed type is "typing.Iterable[builtins.object ]"
29+ reveal_type(p. values()) # N: Revealed type is "typing.ValuesView[builtins.int]"
30+ reveal_type(p.keys ()) # N: Revealed type is "typing.KeysView[Union[Literal['x'], Literal['y']] ]"
3131[builtins fixtures/dict.pyi]
3232[typing fixtures/typing-typeddict.pyi]
3333
@@ -36,7 +36,8 @@ from typing import TypedDict, TypeVar, Union
3636EmptyDict = TypedDict('EmptyDict', {})
3737p = EmptyDict()
3838reveal_type(p) # N: Revealed type is "TypedDict('__main__.EmptyDict', {})"
39- reveal_type(p.values()) # N: Revealed type is "typing.Iterable[builtins.object]"
39+ reveal_type(p.values()) # N: Revealed type is "typing.ValuesView[Never]"
40+ reveal_type(p.keys()) # N: Revealed type is "typing.KeysView[Never]"
4041[builtins fixtures/dict.pyi]
4142[typing fixtures/typing-typeddict.pyi]
4243
@@ -534,8 +535,8 @@ Point3D = TypedDict('Point3D', {'x': int, 'y': int, 'z': int})
534535p1 = TaggedPoint(type='2d', x=0, y=0)
535536p2 = Point3D(x=1, y=1, z=1)
536537joined_points = [p1, p2][0]
537- reveal_type(p1.values()) # N: Revealed type is "typing.Iterable[ builtins.object ]"
538- reveal_type(p2.values()) # N: Revealed type is "typing.Iterable [builtins.object ]"
538+ reveal_type(p1.values()) # N: Revealed type is "typing.ValuesView[Union[ builtins.str, builtins.int] ]"
539+ reveal_type(p2.values()) # N: Revealed type is "typing.ValuesView [builtins.int ]"
539540reveal_type(joined_points) # N: Revealed type is "TypedDict({'x': builtins.int, 'y': builtins.int})"
540541[builtins fixtures/dict.pyi]
541542[typing fixtures/typing-typeddict.pyi]
0 commit comments