Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Misaligned columns in help('topics') due to the length of "ASSIGNMENTEXPRESSIONS" #125225

Closed
Labels
docsDocumentation in the Doc dir
@EtiennePelletier

Description

@EtiennePelletier

Documentation

Description

Thepydoc.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) inPR 124641 causes misaligned columns with these default values. As seen in Python 3.13.0:

>>> help('topics')Here is a list of available topics.  Enter any topic name to get more help.ASSERTION           DEBUGGING           LITERALS            SEQUENCESASSIGNMENT          DELETION            LOOPING             SHIFTINGASSIGNMENTEXPRESSIONS DICTIONARIES        MAPPINGMETHODS      SLICINGSATTRIBUTEMETHODS    DICTIONARYLITERALS  MAPPINGS            SPECIALATTRIBUTESATTRIBUTES          DYNAMICFEATURES     METHODS             SPECIALIDENTIFIERS...

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:

  1. 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:

    ASSERTION             DEBUGGING             LITERALS              SEQUENCESASSIGNMENT            DELETION              LOOPING               SHIFTINGASSIGNMENTEXPRESSIONS DICTIONARIES          MAPPINGMETHODS        SLICINGSATTRIBUTEMETHODS      DICTIONARYLITERALS    MAPPINGS              SPECIALATTRIBUTESATTRIBUTES            DYNAMICFEATURES       METHODS               SPECIALIDENTIFIERS...
  2. 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:

    ASSERTION                 EXCEPTIONS                PACKAGESASSIGNMENT                EXECUTION                 POWERASSIGNMENTEXPRESSIONS     EXPRESSIONS               PRECEDENCEATTRIBUTEMETHODS          FLOAT                     PRIVATENAMESATTRIBUTES                FORMATTING                RETURNING...

🙂

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp