Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6cd0236

Browse files
committedOct 11, 2024··
Fix column misalignment in help('topics') output
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.
1 parent f2cb399 commit 6cd0236

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
@@ -2083,7 +2083,7 @@ def intro(self):
20832083
'''.format('%d.%d' % sys.version_info[:2]))
20842084

20852085
def list(self, items, columns=4, width=80):
2086-
items = list(sorted(items))
2086+
items = sorted(items)
20872087
colw = width / columns
20882088
rows = (len(items) + columns - 1) / columns
20892089
for row in range(rows):
@@ -2115,7 +2115,7 @@ def listtopics(self):
21152115
Here is a list of available topics. Enter any topic name to get more help.
21162116
21172117
''')
2118-
self.list(self.topics.keys())
2118+
self.list(self.topics.keys(), columns=3)
21192119

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

0 commit comments

Comments
 (0)
Please sign in to comment.

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant