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

Conversation

EtiennePelletier
Copy link
Contributor

@EtiennePelletier EtiennePelletier commented Oct 9, 2024

This PR addresses the issue described in issue 125225.

The output of help("topics") was misaligned due to "ASSIGNMENTEXPRESSIONS" exceeding the implicit maximum default column width of 19 characters.

This was achieved by reducing the number of columns from 4 to 3 in the listtopics() function, allowing more space for longer topic names and improving overall readability.

Here are the non-truncated outputs before and after the fix:

Before:

help> topics

Here is a list of available topics.  Enter any topic name to get more help.

ASSERTION           DEBUGGING           LITERALS            SEQUENCES
ASSIGNMENT          DELETION            LOOPING             SHIFTING
ASSIGNMENTEXPRESSIONS DICTIONARIES        MAPPINGMETHODS      SLICINGS
ATTRIBUTEMETHODS    DICTIONARYLITERALS  MAPPINGS            SPECIALATTRIBUTES
ATTRIBUTES          DYNAMICFEATURES     METHODS             SPECIALIDENTIFIERS
AUGMENTEDASSIGNMENT ELLIPSIS            MODULES             SPECIALMETHODS
BASICMETHODS        EXCEPTIONS          NAMESPACES          STRINGMETHODS
BINARY              EXECUTION           NONE                STRINGS
BITWISE             EXPRESSIONS         NUMBERMETHODS       SUBSCRIPTS
BOOLEAN             FLOAT               NUMBERS             TRACEBACKS
CALLABLEMETHODS     FORMATTING          OBJECTS             TRUTHVALUE
CALLS               FRAMEOBJECTS        OPERATORS           TUPLELITERALS
CLASSES             FRAMES              PACKAGES            TUPLES
CODEOBJECTS         FUNCTIONS           POWER               TYPEOBJECTS
COMPARISON          IDENTIFIERS         PRECEDENCE          TYPES
COMPLEX             IMPORTING           PRIVATENAMES        UNARY
CONDITIONAL         INTEGER             RETURNING           UNICODE
CONTEXTMANAGERS     LISTLITERALS        SCOPING
CONVERSIONS         LISTS               SEQUENCEMETHODS

After:

help> topics

Here is a list of available topics.  Enter any topic name to get more help.

ASSERTION                 EXCEPTIONS                PACKAGES
ASSIGNMENT                EXECUTION                 POWER
ASSIGNMENTEXPRESSIONS     EXPRESSIONS               PRECEDENCE
ATTRIBUTEMETHODS          FLOAT                     PRIVATENAMES
ATTRIBUTES                FORMATTING                RETURNING
AUGMENTEDASSIGNMENT       FRAMEOBJECTS              SCOPING
BASICMETHODS              FRAMES                    SEQUENCEMETHODS
BINARY                    FUNCTIONS                 SEQUENCES
BITWISE                   IDENTIFIERS               SHIFTING
BOOLEAN                   IMPORTING                 SLICINGS
CALLABLEMETHODS           INTEGER                   SPECIALATTRIBUTES
CALLS                     LISTLITERALS              SPECIALIDENTIFIERS
CLASSES                   LISTS                     SPECIALMETHODS
CODEOBJECTS               LITERALS                  STRINGMETHODS
COMPARISON                LOOPING                   STRINGS
COMPLEX                   MAPPINGMETHODS            SUBSCRIPTS
CONDITIONAL               MAPPINGS                  TRACEBACKS
CONTEXTMANAGERS           METHODS                   TRUTHVALUE
CONVERSIONS               MODULES                   TUPLELITERALS
DEBUGGING                 NAMESPACES                TUPLES
DELETION                  NONE                      TYPEOBJECTS
DICTIONARIES              NUMBERMETHODS             TYPES
DICTIONARYLITERALS        NUMBERS                   UNARY
DYNAMICFEATURES           OBJECTS                   UNICODE
ELLIPSIS                  OPERATORS                 

@ghost
Copy link

ghost commented Oct 9, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Oct 9, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app
Copy link

bedevere-app bot commented Oct 11, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

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.
@bedevere-app
Copy link

bedevere-app bot commented Feb 21, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@EtiennePelletier
Copy link
Contributor Author

I believe the skip news label should be added to this PR.

@ambv ambv added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes skip news labels May 19, 2025
@ambv ambv merged commit b22460c into python:main May 19, 2025
38 checks passed
@miss-islington-app
Copy link

Thanks @EtiennePelletier for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request 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 pull request 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]>
@bedevere-app
Copy link

bedevere-app bot commented May 19, 2025

GH-134225 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label May 19, 2025
@bedevere-app
Copy link

bedevere-app bot commented May 19, 2025

GH-134226 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label May 19, 2025
@EtiennePelletier EtiennePelletier deleted the pydoc_columns branch May 19, 2025 14:26
ambv added a commit that referenced this pull request 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 pull request 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants