feat: add Exception classes

This commit is contained in:
Shunsuke Shibayama 2024-03-11 20:35:11 +09:00
parent a136d6dc18
commit 0e1c0a9a13
4 changed files with 718 additions and 3 deletions

View file

@ -17,7 +17,7 @@ def try_(p, exc=lambda _: None, els=lambda: None, fin=lambda: None):
.try! = unsound.pyeval("try_")
assert .try! in |T, U|(
p!: () => T,
exc!: (exception: Obj) => U := (exception: Obj) => NoneType,
exc!: (exception: BaseException) => U := (exception: BaseException) => NoneType,
else! := () => NoneType,
finally! := () => NoneType,
) => T or U