这段程序会输出什么?

来自 上下文管理器
Python 3.14 进阶 3分钟

这段程序会输出什么?

Python
class Gate:
    def __enter__(self):
        print("enter")
        return 7

    def __exit__(self, exc_type, exc_value, traceback):
        print("exit", exc_type.__name__)
        return exc_type is LookupError


with Gate() as value:
    print(value)
    raise LookupError("missing")
print("after")
在试验场中打开
报告错误