| -- Create Type |
| |
| -- TODO: Implement support for this syntax. |
| --[case testCanCreateTypedDictTypeWithKeywordArguments] |
| --from mypy_extensions import TypedDict |
| --Point = TypedDict('Point', x=int, y=int) |
| --[builtins fixtures/dict.pyi] |
| --[out] |
| --MypyFile:1( |
| -- ImportFrom:1(mypy_extensions, [TypedDict]) |
| -- AssignmentStmt:2( |
| -- NameExpr(Point* [__main__.Point]) |
| -- TypedDictExpr:2(Point))) |
| |
| -- TODO: Implement support for this syntax. |
| --[case testCanCreateTypedDictTypeWithDictCall] |
| --from mypy_extensions import TypedDict |
| --Point = TypedDict('Point', dict(x=int, y=int)) |
| --[builtins fixtures/dict.pyi] |
| --[out] |
| --MypyFile:1( |
| -- ImportFrom:1(mypy_extensions, [TypedDict]) |
| -- AssignmentStmt:2( |
| -- NameExpr(Point* [__main__.Point]) |
| -- TypedDictExpr:2(Point))) |
| |
| [case testCanCreateTypedDictTypeWithDictLiteral] |
| from mypy_extensions import TypedDict |
| Point = TypedDict('Point', {'x': int, 'y': int}) |
| [builtins fixtures/dict.pyi] |
| [out] |
| MypyFile:1( |
| ImportFrom:1(mypy_extensions, [TypedDict]) |
| AssignmentStmt:2( |
| NameExpr(Point* [__main__.Point]) |
| TypedDictExpr:2(Point))) |
| |
| [case testTypedDictWithDocString] |
| from mypy_extensions import TypedDict |
| class A(TypedDict): |
| """foo""" |
| x: str |
| [builtins fixtures/dict.pyi] |
| [out] |
| MypyFile:1( |
| ImportFrom:1(mypy_extensions, [TypedDict]) |
| ClassDef:2( |
| A |
| BaseType( |
| mypy_extensions._TypedDict) |
| ExpressionStmt:3( |
| StrExpr(foo)) |
| AssignmentStmt:4( |
| NameExpr(x) |
| TempNode:4( |
| Any) |
| str?))) |