Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions Doc/library/traceback.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,19 @@ Module-Level Functions

.. function:: print_list(extracted_list, file=None)

Print the list of tuples as returned by :func:`extract_tb` or
:func:`extract_stack` as a formatted stack trace to the given file.
Print a list of :class:`FrameSummary` objects as returned by
:func:`extract_tb` or :func:`extract_stack`, or a list of old-style tuples
(see :meth:`StackSummary.from_list`), as a formatted stack trace to the
given file.
If *file* is ``None``, the output is written to :data:`sys.stderr`.


.. function:: format_list(extracted_list)

Given a list of tuples or :class:`FrameSummary` objects as returned by
:func:`extract_tb` or :func:`extract_stack`, return a list of strings ready
for printing. Each string in the resulting list corresponds to the item with
Given a list of :class:`FrameSummary` objects as returned by
:func:`extract_tb` or :func:`extract_stack`, or a list of old-style tuples
(see :meth:`StackSummary.from_list`), return a list of strings ready for
printing. Each string in the resulting list corresponds to the item with
the same index in the argument list. Each string ends in a newline; the
strings may contain internal newlines as well, for those items whose source
text line is not ``None``.
Expand Down Expand Up @@ -536,8 +539,8 @@ in a :ref:`traceback <traceback-objects>`.

.. attribute:: FrameSummary.line

A string representing the source code for this frame, with leading and
trailing whitespace stripped.
The source line at :attr:`~FrameSummary.lineno`,
with leading and trailing whitespace stripped.
If the source is not available, it is ``None``.

.. attribute:: FrameSummary.end_lineno
Expand Down
Loading