| [case testLiteralSemanalBasicAssignment] |
| from typing_extensions import Literal |
| foo: Literal[3] |
| [out] |
| MypyFile:1( |
| ImportFrom:1(typing_extensions, [Literal]) |
| AssignmentStmt:2( |
| NameExpr(foo [__main__.foo]) |
| TempNode:2( |
| Any) |
| Literal[3])) |
| |
| [case testLiteralSemanalInFunction] |
| from typing_extensions import Literal |
| def foo(a: Literal[1], b: Literal[" foo "]) -> Literal[True]: pass |
| [builtins fixtures/bool.pyi] |
| [out] |
| MypyFile:1( |
| ImportFrom:1(typing_extensions, [Literal]) |
| FuncDef:2( |
| foo |
| Args( |
| Var(a) |
| Var(b)) |
| def (a: Literal[1], b: Literal[' foo ']) -> Literal[True] |
| Block:2( |
| PassStmt:2()))) |