-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Misaligned columns in help('topics') due to the length of "ASSIGNMENTEXPRESSIONS" #125225
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
Labels
docs
Documentation in the Doc dir
Comments
I'm in favor of your option 2. Are you interested in submitting a pull request? |
ambv
added a commit
that referenced
this issue
May 19, 2025
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. Co-authored-by: Łukasz Langa <[email protected]>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
May 19, 2025
…thongh-125226) 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]>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
May 19, 2025
…thongh-125226) 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]>
ambv
added a commit
that referenced
this issue
May 19, 2025
…h-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]>
ambv
added a commit
that referenced
this issue
May 19, 2025
…h-125226) (#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]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Documentation
Description
The
pydoc.Helper.list
function currently uses default values of 80 characters per line and 4 columns. This provides an implicit maximum length of 19 characters per item to ensure columns are aligned properly (the item length is not verified within the function).Historically, the longest values were
_testimportmultiple
fromhelp('module')
andAUGMENTEDASSIGNMENT
fromhelp('topics')
, both with a length of 19 characters.The recent addition of
"ASSIGNMENTEXPRESSIONS"
(21 characters) in PR 124641 causes misaligned columns with these default values. As seen in Python 3.13.0:Impact
This misalignment affects the readability of the output, making it a bit more difficult to quickly scan through it.
Proposed Solutions
I see two simple options to address this issue, but I’m open to any other suggestions as well:
Increase the line width to 88 characters:
To preserve the default four columns, a minimum width of 88 characters would be required to ensure each item, including
"ASSIGNMENTEXPRESSIONS"
, fits within its column:Reduce the number of columns to 3 (Recommendation):
Reducing the column count to 3 when listing topics would provide enough space for longer topic names (up to 25 characters). This solution is preferred for compatibility with many terminals that default to 80 characters per line:
🙂
Linked PRs
The text was updated successfully, but these errors were encountered: