8000 GH-89455: Add missing attributes (added in 3.11) to traceback module docs by Jackenmen · Pull Request #105044 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-89455: Add missing attributes (added in 3.11) to traceback module docs #105044

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
May 29, 2023
Prev Previous commit
Next Next commit
Add max_group_width/depth
  • Loading branch information
Jackenmen committed May 28, 2023
commit 422161867874e7ae32c878cfda3bc21705384c60
10 changes: 9 additions & 1 deletion Doc/library/traceback.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -230,6 +230,11 @@ 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. 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__``.
Expand Down Expand Up @@ -343,6 +348,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
-----------------------------
Expand Down
0