Skip to content

gh-125225 Fix column misalignment in help('topics') output #125226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Lib/pydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2110,7 +2110,7 @@ def intro(self):
self.output.write(_introdoc())

def list(self, items, columns=4, width=80):
items = list(sorted(items))
items = sorted(items)
colw = width // columns
rows = (len(items) + columns - 1) // columns
for row in range(rows):
Expand Down Expand Up @@ -2142,7 +2142,7 @@ def listtopics(self):
Here is a list of available topics. Enter any topic name to get more help.

''')
self.list(self.topics.keys())
self.list(self.topics.keys(), columns=3)

def showtopic(self, topic, more_xrefs=''):
try:
Expand Down
Loading