Skip to content

Commit c1e4770

Browse files
miss-islingtonEtiennePelletierambv
authored
[3.13] pythongh-125225: Fix column misalignment in help('topics') output (pythongh-125226) (python#134226)
The 'help("topics")' output was misaligned due to "ASSIGNMENTEXPRESSIONS" exceeding the implicit maximum default column width of 19 characters. Reduced the number of columns from 4 to 3 in the listtopics() function to allow more space for longer topic names. (cherry picked from commit b22460c) Co-authored-by: Étienne Pelletier <[email protected]> Co-authored-by: Łukasz Langa <[email protected]>
1 parent 08c9ba5 commit c1e4770

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/pydoc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2082,7 +2082,7 @@ def intro(self):
20822082
'''.format('%d.%d' % sys.version_info[:2]))
20832083

20842084
def list(self, items, columns=4, width=80):
2085-
items = list(sorted(items))
2085+
items = sorted(items)
20862086
colw = width // columns
20872087
rows = (len(items) + columns - 1) // columns
20882088
for row in range(rows):
@@ -2114,7 +2114,7 @@ def listtopics(self):
21142114
Here is a list of available topics. Enter any topic name to get more help.
21152115
21162116
''')
2117-
self.list(self.topics.keys())
2117+
self.list(self.topics.keys(), columns=3)
21182118

21192119
def showtopic(self, topic, more_xrefs=''):
21202120
try:

0 commit comments

Comments
 (0)