GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Line overflow in pydoc output due to long docstrings · Issue #150285 · python/cpython

Line overflow in pydoc output due to long docstrings #150285

New issue
Copy link
New issue
Copy link
Closed
Closed
Line overflow in pydoc output due to long docstrings#150285
Copy link
Assignees
serhiy-storchaka
Labels
3.15bugs and security fixesbugs and security fixes3.16new features, bugs and security fixesnew features, bugs and security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirtopic-argument-clinic

Description

@serhiy-storchaka
serhiy-storchaka
opened on May 23, 2026
Issue body actions

Following PEP 8 automatically leads to pydoc generating outpurt that fits in 80 columns, except some long signatures, inherited standard docstrings and URIs. Exceptions happen here and there, and I usually fix them whem working on the module. Things are more complicated with the C code. Old docstrings mostly fit in 80 columns, but Argument Clinic provokes writing longer lines. There is a check for docstring line width, but it is incorrect. It's now a chicken and egg problem. We cannot simply fix the limits in Argument Clinic, because this will produce a large amount of warnings and errors (especially in recently added modules), but until it was fixed, the new code will add too long docstrings.

There are only few modules which need large number of corrections and many modules which require only 1-2 fixes. Most modules do not need any changes. I am going to fix large modules in separate PRs, then fix many simple cases at once and fix the limits in Argument Clinic.

Linked PRs

  • gh-150285: Fix too long docstrings in the curses module #150286
  • gh-150285: Fix too long docstrings in the io module #150287
  • gh-150285: Fix too long docstrings in the decimal module #150288
  • gh-150285: Fix too long docstrings in the _remote_debugging module #150289
  • gh-150285: Fix too long docstrings in the sqlite3 module #150290
  • gh-150285: Fix too long docstrings in the zstd module #150291
  • gh-150285: Fix too long docstrings in builtins #150293
  • gh-150285: Fix too long docstrings in the pyexpat module #150294
  • gh-150285: Fix too long docstrings in the os module #150296
  • [3.15] gh-150285: Fix too long docstrings in the curses module (GH-150286) #150331
  • [3.15] gh-150285: Fix too long docstrings in the io module (GH-150287) #150332
  • [3.15] gh-150285: Fix too long docstrings in the decimal module (GH-150288) #150333
  • [3.15] gh-150285: Fix too long docstrings in the _remote_debugging module (GH-150289) #150334
  • [3.15] gh-150285: Fix too long docstrings in the zstd module (GH-150291) #150335
  • [3.15] gh-150285: Fix too long docstrings in builtins (GH-150293) #150336
  • [3.15] gh-150285: Fix too long docstrings in the pyexpat module (GH-150294) #150337
  • gh-150285: Fix too long docstrings in Argument Clinic code #150338
  • [3.15] gh-150285: Fix too long docstrings in the sqlite3 module (GH-150290) #150340
  • [3.15] gh-150285: Fix too long docstrings in the os module (GH-150296) #150341
  • [3.15] gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) #150350
  • gh-150285: Fix too long docstrings in some Python modules #150366
  • gh-150285: Fix too long docstrings in _wmi.exec_query #150373
  • [3.15] gh-150285: Fix too long docstrings in some Python modules (GH-150366) #150375
  • [3.15] gh-150285: Fix too long docstrings in _wmi.exec_query (GH-150373) #150377
  • [3.14] gh-150285: Fix too long docstrings in the zstd module (GH-150291) (GH-150335) #150421
  • [3.14] gh-150285: Fix too long docstrings in the curses module (GH-150286) #150457
  • [3.14] gh-150285: Fix too long docstrings in the io module (GH-150287) #150458
  • [3.14] gh-150285: Fix too long docstrings in the decimal module (GH-150288) #150460
  • [3.14] gh-150285: Fix too long docstrings in the sqlite3 module (GH-150290) #150461
  • [3.14] gh-150285: Fix too long docstrings in the pyexpat module (GH-150294) #150463
  • [3.14] gh-150285: Fix too long docstrings in the os module (GH-150296) (GH-150341) #150464
  • [3.13] gh-150285: Fix too long docstrings in the decimal module (GH-150288) (GH-150460) #150465
  • [3.14] gh-150285: Fix too long docstrings in builtins (GH-150293) #150466
  • [3.13] gh-150285: Fix too long docstrings in the pyexpat module (GH-150294) (GH-150463) #150468
  • [3.13] gh-150285: Fix too long docstrings in the curses module (GH-150286) (GH-150457) #150469
  • [3.13] gh-150285: Fix too long docstrings in the io module (GH-150287) (GH-150458) #150470
  • [3.13] gh-150285: Fix too long docstrings in the sqlite3 module (GH-150290) (GH-150461) #150471
  • [3.13] gh-150285: Fix too long docstrings in builtins (GH-150293) (GH-150466) #150472
  • [3.14] gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) (GH-150350) #150473
  • [3.14] gh-150285: Fix too long docstrings in some Python modules (GH-150366) (GH-150375) #150519
  • [3.14] gh-150285: Fix too long docstrings in _wmi.exec_query (GH-150373) #150520
  • [3.13] gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) (GH-150350) (GH-150473) #150526
  • [3.13] gh-150285: Fix too long docstrings in some Python modules (GH-150366) (GH-150375) (GH-150519) #150530
  • [3.13] gh-150285: Fix too long docstrings in _wmi.exec_query (GH-150373) (GH-150520) #150531
  • gh-150285: Fix too long docstrings in the asyncio package #151074
  • gh-150285: Fix too long docstrings in the concurrent package #151076
  • gh-150285: Wrap long single-line summary in text output in pydoc #151081
  • [3.15] gh-150285: Fix too long docstrings in the asyncio package (GH-151074) #151172
  • [3.15] gh-150285: Fix too long docstrings in the concurrent package (GH-151076) #151173
  • [3.14] gh-150285: Fix too long docstrings in the concurrent package (GH-151076) #151174
  • [3.14] gh-150285: Fix too long docstrings in the asyncio package (GH-151074) #151175
  • [3.13] gh-150285: Fix too long docstrings in the concurrent package (GH-151076) #151178
  • [3.13] gh-150285: Fix too long docstrings in the asyncio package (GH-151074) (GH-151175) #151185
  • [3.13] gh-150285: Fix merging error in GH-150458 #151320
  • gh-150285: Suppress showing the __getstate__() comment in the help for dataclasses #151328
  • [3.15] gh-150285: Suppress showing the __getstate__() comment in the help for dataclasses (GH-151328) #151331
  • [3.14] gh-150285: Suppress showing the __getstate__() comment in the help for dataclasses (GH-151328) #151332
  • [3.13] gh-150285: Suppress showing the __getstate__() comment in the help for dataclasses (GH-151328) #151333
  • gh-150285: Fix too long docstrings in GenericAlias and __class_getitem__ #151354
  • gh-150285: Fix overflow in too long lines for class data in pydoc #151366
  • [3.15] gh-150285: Fix too long docstrings in GenericAlias and __class_getitem__ (GH-151354) #151367
  • [3.14] gh-150285: Fix too long docstrings in GenericAlias and __class_getitem__ (GH-151354) #151368
  • [3.13] gh-150285: Fix too long docstrings in GenericAlias and __class_getitem__ (GH-151354) #151369
  • [3.13] gh-150285: Fix too long docstrings in the os module (GH-150296) (GH-150341) (GH-150464) #153755

Activity

Next
  1. serhiy-storchaka
    self-assigned this
    on May 23, 2026
  2. serhiy-storchaka
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    topic-argument-clinic
    3.15bugs and security fixesbugs and security fixes
    3.16new features, bugs and security fixesnew features, bugs and security fixes
    on May 23, 2026
  3. github-project-automation
    added this to docs issueson May 23, 2026
  4. github-project-automation
    moved this to Todo in docs issueson May 23, 2026
  5. serhiy-storchaka
    added 2 commits that reference this issue on May 23, 2026

    pythongh-150285: Fix too long docstrings in the curses module

    40e6ee4

    pythongh-150285: Fix too long docstrings in the io module

    9f4bab7
  6. omkar-334 commented on May 23, 2026

    @omkar-334
    omkar-334
    on May 23, 2026
    Contributor
    More actions

    hey @serhiy-storchaka is there any module i can help with, maybe the many small modules with 1-2 fixes?

  7. serhiy-storchaka commented on May 23, 2026

    @serhiy-storchaka
    serhiy-storchaka
    on May 23, 2026
    MemberAuthor
    More actions

    No, I already wrote them. I wait for merging the submitted PRs before uploading the rest.

    Reacted by Omkar Kabde
  8. omkar-334 commented on May 23, 2026

    @omkar-334
    omkar-334
    on May 23, 2026
    Contributor
    More actions

    ok, got it, thanks!....i am interested in contributing more so i had asked

  9. serhiy-storchaka
    added 3 commits that reference this issue on May 24, 2026

    gh-150285: Fix too long docstrings in the curses module (GH-150286)

    4c0fe2d

    gh-150285: Fix too long docstrings in the io module (GH-150287)

    160dc74

    gh-150285: Fix too long docstrings in the decimal module (GH-150288)

    6bed57a
  10. 65 remaining items

  11. serhiy-storchaka
    added 6 commits that reference this issue on Jun 11, 2026

    [3.14] gh-150285: Suppress showing the __getstate__() comment in the …

    7a3a788

    gh-150285: Fix too long docstrings in GenericAlias and __class_getite…

    65047f2

    [3.13] gh-150285: Fix too long docstrings in GenericAlias and __class…

    c4f3d8c

    [3.14] gh-150285: Fix too long docstrings in GenericAlias and __class…

    b6d3236

    [3.15] gh-150285: Fix too long docstrings in GenericAlias and __class…

    f3fd7b8

    gh-150285: Fix overflow in too long lines for class data in pydoc (GH…

    d2e27ac
  12. hugovk commented on Jun 14, 2026

    @hugovk
    hugovk
    on Jun 14, 2026
    Member
    More actions

    @AlexWaygood Is there a Ruff rule that can prevent future overlong docstrings being introduced?

    I don't know of one, unfortunately. A good way of answering that kind of question is usually to go to the Ruff playground, enable ALL in the configuration settings, and see if the code triggers any lints. We can see here that the very long first line triggers E501 (a general lint about lines being too long, which would also be triggered if it was a short sentence that was heavily indented), but doesn't trigger any specific lints about the first line of the docstring being a sentence that's too long. play.ruff.rs/c4ac905d-e485-4b24-a035-833ef07c4e84

    I'd personally be happy to consider adding a rule like this (but I can't speak for the whole Ruff team -- definitely open an issue if it's something you're interested in!)

    There's almost a rule for this, I've opened astral-sh/ruff#25995 :)

  13. philthompson10
    added 6 commits that reference this issue on Jun 17, 2026

    pythongh-150285: Fix too long docstrings in the asyncio package (pyth…

    2b95d29

    pythongh-150285: Fix too long docstrings in the concurrent package (p…

    ae445aa

    pythongh-150285: Wrap long single-line summary in text output in pydoc (

    1ae23a6

    pythongh-150285: Suppress showing the __getstate__() comment in the h…

    95102f6

    pythongh-150285: Fix too long docstrings in GenericAlias and __class_…

    9cf40d9

    pythongh-150285: Fix overflow in too long lines for class data in pyd…

    33e8716
  14. serhiy-storchaka
    closed this as completedon Jun 30, 2026
  15. serhiy-storchaka
    added a commit that references this issue on Jul 15, 2026

    [3.13] gh-150285: Fix too long docstrings in the os module (GH-150296) (

    3bce254
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @serhiy-storchaka
    serhiy-storchaka

Labels

3.15bugs and security fixesbugs and security fixes3.16new features, bugs and security fixesnew features, bugs and security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirtopic-argument-clinic

Projects

  • docs issues
    Status
    Todo
    Show more project fields

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.