[issue30984] traceback.print_exc return value documentation
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@python
components: Documentation
messages: 298807
nosy: Jelle Zijlstra, docs@python
priority: normal
severity: normal
status: open
title: traceback.print_exc return value documentation
versions: Python 3.6, Python 3.7
_______________________________________
Python tracker
participants (2)
-
Berker Peksag
-
Jelle Zijlstra