This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2017年07月21日 15:32 by JelleZijlstra, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg298807 - (view) | Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) | Date: 2017年07月21日 15:32 | |
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. |
|||
| msg322973 - (view) | Author: Berker Peksag (berker.peksag) * (Python committer) | Date: 2018年08月02日 15:57 | |
The documentation you've quoted is for traceback.extract_tb(). traceback.format_tb() documentation only says: A shorthand for ``format_list(extract_tb(tb, limit))``. Issue 27910 is about updating the documentation of extract_tb(), format_list(), and StackSummary.from_list(). I'm closing this as a duplicate of issue 27910. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:49 | admin | set | github: 75167 |
| 2018年08月02日 15:57:41 | berker.peksag | set | status: open -> closed superseder: Doc/library/traceback.rst — references to tuples should be replaced with new FrameSummary object type: behavior nosy: + berker.peksag messages: + msg322973 resolution: duplicate stage: resolved |
| 2017年07月21日 15:32:50 | JelleZijlstra | create | |