Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumPythonexception chainingSingle-choice MCQ

Inside an except handler you build a new exception and assign its `__cause__` attribute directly (no `raise ... from`). What is `__suppress_context__` after it is raised, and why?

try: raise KeyError("k") except KeyError as k: e = RuntimeError("r") e.__cause__ = k print(e.__suppress_context__)