Hello,
Context:
- An abstract method is defined
- The docstring of this abstract method has a return statement
- There is (obviously) no implementation in the abstract method ... and so no return statement
Actual result:
DOC202 Docstring should not have a returns section because the function doesn't return anything
Expected result:
No error
Keywords searched in issues list before creating this issue
Code snippet:
import abc
class A(metaclass=abc.abcmeta):
@abc.abstractmethod
def f(self):
"""Lorem ipsum
Returns
-------
dict:
The values
"""
class C(A):
def f(self): # noqa: PLR6301 - this is for demo purpose
return {}
Remarks:
- Same result with type annotation given in the abstract method definition (e.g.
def f(self) -> dict:)
- In terms of implementation, a possibility could be to check if the method is decorated as abstract before doing this test
Hello,
Context:
Actual result:
DOC202 Docstring should not have a returns section because the function doesn't return anythingExpected result:
No error
Keywords searched in issues list before creating this issue
Code snippet:
Remarks:
def f(self) -> dict:)