Repository navigation
Line overflow in pydoc output due to long docstrings #150285
Description
Activity
- addeddocsDocumentation in the Doc dirDocumentation in the Doc dir3.15bugs and security fixesbugs and security fixes3.16new features, bugs and security fixesnew features, bugs and security fixes
on May 23, 2026 hey @serhiy-storchaka is there any module i can help with, maybe the many small modules with 1-2 fixes?
No, I already wrote them. I wait for merging the submitted PRs before uploading the rest.
Reacted by Omkar Kabdeok, got it, thanks!....i am interested in contributing more so i had asked
65 remaining items
- added 6 commits that reference this issue
on Jun 11, 2026 @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
ALLin 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-833ef07c4e84I'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 :)
- added 6 commits that reference this issue
on Jun 17, 2026
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsTodo
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