PCPP-32-101 · Question #50
Which of the following statements regarding the __traceback__ attribute are true? (Choose two.)
The correct answer is C. The attribute is owned by every exception object. D. The attribute can be easily handled by the traceback.format_tb() method. Every exception object has a __traceback__ attribute that holds the traceback at the point the exception was raised. The traceback.format_tb() function can process the __traceback__ attribute to format the traceback information as a list of strings.
Question
Which of the following statements regarding the traceback attribute are true? (Choose two.)
Options
- AThe attribute is a special method delivered by the traceback module to retrieve a full list of strings
- BThe attribute is owned only by the exception objects residing in an exception chain.
- CThe attribute is owned by every exception object.
- DThe attribute can be easily handled by the traceback.format_tb() method.
How the community answered
(28 responses)- A7% (2)
- B18% (5)
- C75% (21)
Explanation
Every exception object has a traceback attribute that holds the traceback at the point the exception was raised. The traceback.format_tb() function can process the traceback attribute to format the traceback information as a list of strings.
Topics
Community Discussion
No community discussion yet for this question.