diff --git a/Doc/library/traceback.rst b/Doc/library/traceback.rst index 8f167eb3524db21..9e1be62c568ea14 100644 --- a/Doc/library/traceback.rst +++ b/Doc/library/traceback.rst @@ -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``. @@ -536,8 +539,8 @@ in a :ref:`traceback `. .. 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