Repository navigation
Read bare types and prose under Google Raises - #165
Merged
Merged
Conversation
A Raises item that was a type alone, such as ValueError, raised ParseError for its missing colon, and so did a Raises section of plain prose. A type alone on its line is now a raises with that type, its description indented below it if any. A section in which no item starts with a type is one raises with no type, holding the prose. An item with a colon and nothing before it is a raises with no type. Compose writes a type with no description without a colon, and a lone raises with no type as its prose, so both read back the same.
rr-
force-pushed
the
rework/28-google-raises
branch
from
November 6, 2026 17:30
1e60c46 to
bd9687d
Compare
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.
Google
Raises:sections written without theType: textform madeparse()raiseParseError:Now:
KeyError, TypeError,os.error or IOError), as do Sphinx-marked ones (~pkg.Error). A description indented below the type belongs to it, as Numpydoc writes it.If the input is bad: a ValueError.) counts as prose, because the text before its colon has spaces.ValueError: Bad.thenTypeErrorgives two raises.: text, with nothing before the colon, gives a raises with no type instead oftype_name=''.Compose writes a type with no description without the colon, and a lone raises with no type as its prose, so both read back the same. A raises with no type among typed ones still composes as
: text.Parity against main: 381 of 29,127 docstrings differ, and every one is about raises.
Raises:,Exceptions:,Except:): 6 case inputs, 1 stdlib and 263 generated. 163 of them used to raiseParseErrorinparse googleand now parse, including the real google-auth docstringOnDemandCredentials.refresh. Some others had garbage types like- TypeErrorfrom a bullet list, which is now one raises holding the list. In auto mode these can now pick Google, as forOnDemandCredentials.refreshand the stdlibsslmodule docstring, whoseExceptions:section now reads as one typeless raises.Bench on 3.8: parse 0.99–1.01x of main, compose google 1.01–1.02x.