blob: 9a314715133a0c8d4b1da9b0edbe88b5bb0e0912 [file] [edit]
[case testTryExceptStar]
try:
x
except* ValueError:
y
[out]
MypyFile:1(
TryStmt:1(
Block:2(
ExpressionStmt:2(
NameExpr(x)))
*
NameExpr(ValueError)
Block:4(
ExpressionStmt:4(
NameExpr(y)))))
[case testTryExceptStarWithVar]
try:
x
except* Exception as e:
y
[out]
MypyFile:1(
TryStmt:1(
Block:2(
ExpressionStmt:2(
NameExpr(x)))
*
NameExpr(Exception)
NameExpr(e)
Block:4(
ExpressionStmt:4(
NameExpr(y)))))
[case testTryMultipleExceptStar]
try:
x
except* ValueError:
y
except* KeyError as e:
z
[out]
MypyFile:1(
TryStmt:1(
Block:2(
ExpressionStmt:2(
NameExpr(x)))
*
NameExpr(ValueError)
Block:4(
ExpressionStmt:4(
NameExpr(y)))
NameExpr(KeyError)
NameExpr(e)
Block:6(
ExpressionStmt:6(
NameExpr(z)))))
[case testTryExceptStarElseFinally]
try:
x
except* ValueError:
y
else:
z
finally:
w
[out]
MypyFile:1(
TryStmt:1(
Block:2(
ExpressionStmt:2(
NameExpr(x)))
*
NameExpr(ValueError)
Block:4(
ExpressionStmt:4(
NameExpr(y)))
Else(
ExpressionStmt:6(
NameExpr(z)))
Finally(
ExpressionStmt:8(
NameExpr(w)))))
[case testUnpackTypeInSignature]
def f(*args: *Ts) -> None:
pass
[out]
MypyFile:1(
FuncDef:1(
f
def (*args: *Ts?) -> None?
VarArg(
Var(args))
Block:2(
PassStmt:2())))
[case testUnpackTypeInTuple]
x: tuple[int, *Ts, str]
[out]
MypyFile:1(
AssignmentStmt:1(
NameExpr(x)
TempNode:1(
Any)
tuple?[int?, *Ts?, str?]))