summaryrefslogtreecommitdiffstats
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2025-05-19 15:22:14 (GMT)
committerGitHub <noreply@github.com>2025-05-19 15:22:14 (GMT)
commit89b744a772978ccd883c289c1a7066c1fb14ac04 (patch)
tree1e561d29e94449e635c97daf08475ff8a3704e11 /Lib/pydoc.py
parentc869898f39a64113689b4d674b996d678dec2843 (diff)
downloadcpython-89b744a772978ccd883c289c1a7066c1fb14ac04.zip
cpython-89b744a772978ccd883c289c1a7066c1fb14ac04.tar.gz
cpython-89b744a772978ccd883c289c1a7066c1fb14ac04.tar.bz2
[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 b22460c44d1bc597c96d4a3d27ad8373d7952820) Co-authored-by: Étienne Pelletier <EtiennePelletier@users.noreply.github.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Diffstat (limited to 'Lib/pydoc.py')
-rw-r--r--Lib/pydoc.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index def76d0..7528178 100644
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -2110,7 +2110,7 @@ has the same effect as typing a particular string at the help> prompt.
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):
@@ -2142,7 +2142,7 @@ to. Enter any symbol to get more help.
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: