MCPcopy Index your code
hub / github.com/python/cpython / format_list

Function format_list

Lib/traceback.py:46–58  ·  view source on GitHub ↗

Format a list of tuples or FrameSummary objects for printing. Given a list of tuples or FrameSummary objects as returned by extract_tb() or extract_stack(), return a list of strings ready for printing. Each string in the resulting list corresponds to the item with the same inde

(extracted_list)

Source from the content-addressed store, hash-verified

44 print(item, file=file, end="")
45
46def format_list(extracted_list):
47 """Format a list of tuples or FrameSummary objects for printing.
48
49 Given a list of tuples or FrameSummary objects as returned by
50 extract_tb() or extract_stack(), return a list of strings ready
51 for printing.
52
53 Each string in the resulting list corresponds to the item with the
54 same index in the argument list. Each string ends in a newline;
55 the strings may contain internal newlines as well, for those items
56 whose source text line is not None.
57 """
58 return StackSummary.from_list(extracted_list).format()
59
60#
61# Printing and Extracting Tracebacks.

Callers 1

format_stackFunction · 0.85

Calls 2

formatMethod · 0.45
from_listMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…