summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorJakub Kuczys <me@jacken.men>2023-05-29 18:28:37 (GMT)
committerGitHub <noreply@github.com>2023-05-29 18:28:37 (GMT)
commit39f6a0489fcc815a578d27dfee2feea003c896f8 (patch)
tree3387c342cbcc39b78488ff5939b9bc9ea7270c55 /Doc
parent6da701511e70fb26ad4710153d8d5a82b809919c (diff)
downloadcpython-39f6a0489fcc815a578d27dfee2feea003c896f8.zip
cpython-39f6a0489fcc815a578d27dfee2feea003c896f8.tar.gz
cpython-39f6a0489fcc815a578d27dfee2feea003c896f8.tar.bz2
GH-89455: Add missing attributes (added in 3.11) to traceback module docs (#105044)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/traceback.rst19
1 files changed, 18 insertions, 1 deletions
diff --git a/Doc/library/traceback.rst b/Doc/library/traceback.rst
index 5c0e261..9a04b56 100644
--- a/Doc/library/traceback.rst
+++ b/Doc/library/traceback.rst
@@ -218,7 +218,7 @@ The module also defines the following classes:
:class:`TracebackException` objects are created from actual exceptions to
capture data for later printing in a lightweight fashion.
-.. class:: TracebackException(exc_type, exc_value, exc_traceback, *, limit=None, lookup_lines=True, capture_locals=False, compact=False)
+.. class:: TracebackException(exc_type, exc_value, exc_traceback, *, limit=None, lookup_lines=True, capture_locals=False, compact=False, max_group_width=15, max_group_depth=10)
Capture an exception for later rendering. *limit*, *lookup_lines* and
*capture_locals* are as for the :class:`StackSummary` class.
@@ -230,6 +230,12 @@ capture data for later printing in a lightweight fashion.
Note that when locals are captured, they are also shown in the traceback.
+ *max_group_width* and *max_group_depth* control the formatting of exception
+ groups (see :exc:`BaseExceptionGroup`). The depth refers to the nesting
+ level of the group, and the width refers to the size of a single exception
+ group's exceptions array. The formatted output is truncated when either
+ limit is exceeded.
+
.. attribute:: __cause__
A :class:`TracebackException` of the original ``__cause__``.
@@ -238,6 +244,14 @@ capture data for later printing in a lightweight fashion.
A :class:`TracebackException` of the original ``__context__``.
+ .. attribute:: exceptions
+
+ If ``self`` represents an :exc:`ExceptionGroup`, this field holds a list of
+ :class:`TracebackException` instances representing the nested exceptions.
+ Otherwise it is ``None``.
+
+ .. versionadded:: 3.11
+
.. attribute:: __suppress_context__
The ``__suppress_context__`` value from the original exception.
@@ -323,6 +337,9 @@ capture data for later printing in a lightweight fashion.
.. versionchanged:: 3.10
Added the *compact* parameter.
+ .. versionchanged:: 3.11
+ Added the *max_group_width* and *max_group_depth* parameters.
+
:class:`StackSummary` Objects
-----------------------------