Repository navigation
Read the whole first paragraph as the short description - #174
Merged
Merged
Conversation
The short description is now the whole first paragraph, every line up
to the first blank line or indented line, in every style, instead of
only the first line. A summary wrapped over two lines, as in
Return the :class:`Foo` for
:meth:`bar` calls.
no longer leaves its second half at the start of the long description.
An indented line still ends it, as it starts a block of its own, and so
does a section title or field, as before.
A line of whitespace before more text ends the paragraph as an empty one
does, so the blank after the short description is kept for it: compose
writes it back as an empty line, and the paragraph reads back the same.
This was referenced Nov 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The short description is now the whole first paragraph, in every style, instead of only its first line. Users with summaries wrapped over two lines get the whole sentence back, and the long description no longer starts halfway through it.
Before:
After:
The paragraph ends at the first blank line. It also ends at an indented line, since that starts a block, and at a section title or field, which end it already. Compose writes a multi-line short description back as it was read, so it round-trips. A line holding only whitespace before more text now counts as the blank line after the short description, so that compose writes it out and the docstring reads back the same.
This is a breaking change: code that expects
short_descriptionto be one line will now see newlines in it.Parity against main: 11743 of 29158 docstrings differ (430 case, 1646 stdlib, 9667 generated). I checked samples from each group, and every diff comes from a summary that spans several lines. The round-trip invariant passes with no new exclusions.
Bench against main: 1.03x at most (parse epydoc).
split_descriptionscans the paragraph with one regex.