-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Expand file tree
/
Copy pathsemanal-typeddict.test
More file actions
48 lines (45 loc) · 1.13 KB
/
semanal-typeddict.test
File metadata and controls
48 lines (45 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
-- Create Type
[case testCanCreateTypedDictTypeWithDictCall-xfail]
-- TODO: Implement support for this syntax.
from typing import TypedDict
Point = TypedDict('Point', dict(x=int, y=int))
[builtins fixtures/dict.pyi]
[typing fixtures/typing-typeddict.pyi]
[out]
MypyFile:1(
ImportFrom:1(typing, [TypedDict])
AssignmentStmt:2(
NameExpr(Point* [__main__.Point])
TypedDictExpr:2(Point)))
[case testCanCreateTypedDictTypeWithDictLiteral]
from typing import TypedDict
Point = TypedDict('Point', {'x': int, 'y': int})
[builtins fixtures/dict.pyi]
[typing fixtures/typing-typeddict.pyi]
[out]
MypyFile:1(
ImportFrom:1(typing, [TypedDict])
AssignmentStmt:2(
NameExpr(Point* [__main__.Point])
TypedDictExpr:2(Point)))
[case testTypedDictWithDocString]
from typing import TypedDict
class A(TypedDict):
"""foo"""
x: str
[builtins fixtures/dict.pyi]
[typing fixtures/typing-typeddict.pyi]
[out]
MypyFile:1(
ImportFrom:1(typing, [TypedDict])
ClassDef:2(
A
BaseType(
typing._TypedDict)
ExpressionStmt:3(
StrExpr(foo))
AssignmentStmt:4(
NameExpr(x)
TempNode:4(
Any)
builtins.str)))