You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.
When a function features multiple Returns/Yields they cannot be individually mentioned in the docstring like Parameters would (see code example below).
def multiple_returns(a, b):
"""Multiple returns example.
Parameters
----------
a : int
First integer
b : int
Second integer
Returns
-------
diff : int
b subtracted from a
summation : int
b added to a
"""
diff = a - b
summation = a + b
return diff, summation
Instead darglint raises an error DAR000: Unexpected exception in darglint: Multiple types should be combined into a Union. The error message indicates that the Returns docstring should be structured something like:
Returns
-------
Union[int, int]
Tuple containing:
diff : int
b subtracted from a
summation : int
b added to a
"""
I don't think this is the neatest solution. Eventhough the return is a tuple, I would expect to be able to write a docstring for each individual returned variable. Can this functionality, like in the first example, be added (as an option) to darglint?
The text was updated successfully, but these errors were encountered:
Sure, since it's part of the Numpy docstring spec. I haven't had time to update the numpy parser, but you're welcome to issue a pull request and I'll review it.
When a function features multiple Returns/Yields they cannot be individually mentioned in the docstring like Parameters would (see code example below).
Instead darglint raises an error
DAR000: Unexpected exception in darglint: Multiple types should be combined into a Union
. The error message indicates that the Returns docstring should be structured something like:I don't think this is the neatest solution. Eventhough the return is a tuple, I would expect to be able to write a docstring for each individual returned variable. Can this functionality, like in the first example, be added (as an option) to darglint?
The text was updated successfully, but these errors were encountered: