Skip to content

Commit 89b744a

Browse files
miss-islingtonEtiennePelletierambv
authored
[3.14] gh-125225: Fix column misalignment in help('topics') output (gh-125226) (gh-134225)
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 c869898 commit 89b744a

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
@@ -2110,7 +2110,7 @@ def intro(self):
21102110
self.output.write(_introdoc())
21112111

21122112
def list(self, items, columns=4, width=80):
2113-
items = list(sorted(items))
2113+
items = sorted(items)
21142114
colw = width // columns
21152115
rows = (len(items) + columns - 1) // columns
21162116
for row in range(rows):
@@ -2142,7 +2142,7 @@ def listtopics(self):
21422142
Here is a list of available topics. Enter any topic name to get more help.
21432143
21442144
''')
2145-
self.list(self.topics.keys())
2145+
self.list(self.topics.keys(), columns=3)
21462146

21472147
def showtopic(self, topic, more_xrefs=''):
21482148
try:

0 commit comments

Comments
 (0)