Exception Attributes

BaseExceptionGroup.exceptions — exception attribute

Inspect the immediate children of a group. The tuple is read-only and may contain nested groups as well as leaf exceptions. It contains references to the original exception objects, not deep copies. Traverse nested children explicitly if you need every leaf.

Formal Syntax & Structure

python syntaxpython
group.exceptions

Return Value

tuple[BaseException, ...]

Immediate child exceptions.

Working Example

Example Snippetpython
group = ExceptionGroup("validation", [ValueError("quantity"), TypeError("price")])print([type(child).__name__ for child in group.exceptions])print(type(group.exceptions).__name__)
Python Reference