mirror of
https://github.com/erg-lang/erg.git
synced 2025-07-08 05:35:22 +00:00
11 lines
219 B
Python
11 lines
219 B
Python
exc = import "exception"
|
|
|
|
s = exc.try! do! str("helo")
|
|
# s: Str or NoneType
|
|
assert s == "helo"
|
|
assert s.isascii()
|
|
|
|
i = exc.try! do! int(1 / 0), (exception) =>
|
|
print! exception # division by zero
|
|
0
|
|
assert i == 0
|