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

Function printlist

Lib/test/libregrtest/utils.py:110–122  ·  view source on GitHub ↗

Print the elements of iterable x to stdout. Optional arg width (default 70) is the maximum line length. Optional arg indent (default 4) is the number of blanks with which to begin each line.

(x, width=70, indent=4, file=None)

Source from the content-addressed store, hash-verified

108
109
110def printlist(x, width=70, indent=4, file=None):
111 """Print the elements of iterable x to stdout.
112
113 Optional arg width (default 70) is the maximum line length.
114 Optional arg indent (default 4) is the number of blanks with which to
115 begin each line.
116 """
117
118 blanks = ' ' * indent
119 # Print the sorted list: 'x' may be a '--random' list or a set()
120 print(textwrap.fill(' '.join(str(elt) for elt in sorted(x)), width,
121 initial_indent=blanks, subsequent_indent=blanks),
122 file=file)
123
124
125def print_warning(msg: str) -> None:

Callers 3

display_resultMethod · 0.85
list_casesFunction · 0.85
rerun_failed_testsMethod · 0.85

Calls 3

strFunction · 0.85
fillMethod · 0.45
joinMethod · 0.45

Tested by 1

list_casesFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…