源码索引 / CURRENT IMPLEMENTATION
docs/deep/examples/ast/exception/before.ast.txt
40 行 · 点击行号可定位;函数链接随声明位置更新,不手填行号。
Module(
body=[
Try(
body=[
Assign(
targets=[
Name(id='a', ctx=Store())],
value=Call(
func=Name(id='tool', ctx=Load()),
args=[
Constant(value='lookup')],
keywords=[
keyword(
arg='key',
value=Constant(value='book'))])),
Assign(
targets=[
Name(id='b', ctx=Store())],
value=Call(
func=Name(id='tool', ctx=Load()),
args=[
Constant(value='lookup')],
keywords=[
keyword(
arg='key',
value=Subscript(
value=Name(id='inputs', ctx=Load()),
slice=Constant(value='absent'),
ctx=Load()))]))],
handlers=[
ExceptHandler(
type=Name(id='KeyError', ctx=Load()),
body=[
Assign(
targets=[
Name(id='result', ctx=Store())],
value=Name(id='a', ctx=Load()))])],
orelse=[],
finalbody=[])],
type_ignores=[])