MCPcopy Index your code
hub / github.com/RustPython/RustPython / list

Method list

Lib/pydoc.py:2125–2136  ·  view source on GitHub ↗
(self, items, columns=4, width=80)

Source from the content-addressed store, hash-verified

2123 self.output.write(_introdoc())
2124
2125 def list(self, items, columns=4, width=80):
2126 items = sorted(items)
2127 colw = width // columns
2128 rows = (len(items) + columns - 1) // columns
2129 for row in range(rows):
2130 for col in range(columns):
2131 i = col * rows + row
2132 if i < len(items):
2133 self.output.write(items[i])
2134 if col < columns - 1:
2135 self.output.write(' ' + ' ' * (colw - 1 - len(items[i])))
2136 self.output.write('\n')
2137
2138 def listkeywords(self):
2139 self.output.write(''&#x27;

Callers 4

listkeywordsMethod · 0.95
listsymbolsMethod · 0.95
listtopicsMethod · 0.95
listmodulesMethod · 0.95

Calls 3

sortedFunction · 0.85
lenFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected