micropython/tests/basics/exception1.py

15 wiersze
242 B
Python

print(repr(IndexError()))
print(str(IndexError()))
print(str(IndexError("foo")))
a = IndexError(1, "test", [100, 200])
print(repr(a))
print(str(a))
print(a.args)
s = StopIteration()
print(s.value)
s = StopIteration(1, 2, 3)
print(s.value)