docstring_parser icon indicating copy to clipboard operation
docstring_parser copied to clipboard

[Google style] Parse "Yields" and "Returns" sections together

Open jsh9 opened this issue 2 years ago • 0 comments

Right now, when there are both Yields and Returns sections in the docstring, only the section on the top is parsed.

For example, in this docstring:

"""
Do something

Args:
    arg1 (int):

Yields:
    int: something

Returns:
    int: something else
"""

only the "Yields" section is parsed as DocstringReturns.

And in this docstring:

"""
Do something

Args:
    arg1 (int):

Returns:
    int: something

Yields:
    int: something else
"""

only the "Returns" section is parsed as DocstringReturns.

Is it possible to add a new class DocstringYields and also parse the "Yields" sections when both "Yields" and "Returns" exist in the docstring?

Thank you!

jsh9 avatar Jun 05 '23 10:06 jsh9