Repository navigation
List attributes apart from params - #154
Merged
Merged
Conversation
Docstring.params included attributes, so code comparing a function's documented params with its signature saw a class's attributes among them. params now leaves them out, and the new Docstring.attrs lists them.
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.
Docstring.paramsreturned attributes along with params. A class docstring with bothArgs:andAttributes:gave one list, and users had to checkkindto tell them apart. Linters such as pydoclint compare documented params against a signature and have to filter attributes out first.This is a breaking change for code that read attributes through
params. Attributes are stillDocstringParamobjects withkind=Kind.ATTRIBUTE, sodocstring.metais unchanged. Only theparamsproperty filters differently. Attribute docstrings thatparse_from_objectreads from source show up inattrstoo.Compose works as before, because it writes items by kind.
combine_docstringsmatches the decorated function's signature againstparamsonly. Before, an attribute named like a param could be picked up as that param, or replace the param's description.Parity against main: 0 of 29,074 docstrings differ (case, stdlib and generated), because parse output itself doesn't change. Bench on 3.8: 0.97–1.01x of main.