[New-bugs-announce] [issue30984] traceback.print_exc return value documentation

Jelle Zijlstra report at bugs.python.org
Fri Jul 21 11:32:50 EDT 2017


New submission from Jelle Zijlstra:

The documentation for traceback.format_tb says "Return a list of “pre-processed” stack trace entries extracted from the traceback object tb. It is useful for alternate formatting of stack traces. The optional limit argument has the same meaning as for print_tb(). A “pre-processed” stack trace entry is a 4-tuple (filename, line number, function name, text) representing the information that is usually printed for a stack trace."

However, as of 3.5 it actually returns a StackSummary object, which is a subclass of list and contains FrameSummary objects. FrameSummary objects are not tuples. The documentation is accurate for 3.4 and earlier. I'm surprised this change was made because it seems like a compatibility break, but it's too late to do something about that now.

The documentation should be changed to correct the return value and add a "versionchanged: 3.5" note.

----------
assignee: docs at python
components: Documentation
messages: 298807
nosy: Jelle Zijlstra, docs at python
priority: normal
severity: normal
status: open
title: traceback.print_exc return value documentation
versions: Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30984>
_______________________________________


More information about the New-bugs-announce mailing list