-
Notifications
You must be signed in to change notification settings - Fork 2k
docstring-missing-returns (DOC201) reports on __new__ #13079
Copy link
Copy link
Closed
Labels
docstringRelated to docstring linting or formattingRelated to docstring linting or formattingneeds-decisionAwaiting a decision from a maintainerAwaiting a decision from a maintainerruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
Running ruff check --select DOC201 --preview --isolated on
class Foo:
def __new__(cls, x: int) -> "Foo":
"""A very helpful docstring.
Args:
x: An integer.
"""
... # Do something with x.
return super().__new__(cls)reports a docstring-missing-returns (DOC201) diagnostic.
The expected behaviour is that the return value of a __new__ method is not expected to be documented as it simply returns an instance of the class.
Related to #8085
Search terms: DOC201, docstring-missing-returns, __new__
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
docstringRelated to docstring linting or formattingRelated to docstring linting or formattingneeds-decisionAwaiting a decision from a maintainerAwaiting a decision from a maintainerruleImplementing or modifying a lint ruleImplementing or modifying a lint rule