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

Method list

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

Source from the content-addressed store, hash-verified

2076 self.output.write(_introdoc())
2077
2078 def list(self, items, columns=4, width=80):
2079 items = sorted(items)
2080 colw = width // columns
2081 rows = (len(items) + columns - 1) // columns
2082 for row in range(rows):
2083 for col in range(columns):
2084 i = col * rows + row
2085 if i < len(items):
2086 self.output.write(items[i])
2087 if col < columns - 1:
2088 self.output.write(' ' + ' ' * (colw - 1 - len(items[i])))
2089 self.output.write('\n')
2090
2091 def listkeywords(self):
2092 self.output.write(''&#x27;

Callers 4

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

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected