exceptions and errors Flashcards
1
Q
exception tuple args
A
e.args
2
Q
what str on exception object return
A
e.args[-1]
3
Q
atribute for original exception if error occurs in the except block
A
__context__
4
Q
how to make explicit chain error
A
raise MyException from e
5
Q
which attribute is using for assosiation with error
A
__cause__
6
Q
attribute which contains a refrence of traceback object
A
__traceback__
7
Q
print traceback object
A
traceback.print_tb(e.__traceback__)
8
Q
make assertion
A
assert condition [, message]
9
Q
python flag to ignore assertions
A
-O