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
For a numpy returns section, it seems like there may be some small issues with two cases:
when there is no name or type annotation specified (the annotation becomes ":")
when there is only an annotation (the annotation starts with ": ")
Here's a docstring with comments trying to explain the two cases:
Returns
-------
list of int
A list of integers.
flag : bool
Some kind
of flag.
x :
Name only
# new case ----
# worked in a previous version of griffe. For functions with a single returns, this is
# useful for having the return value be the functions return type hint
:
No name or annotation
# new case ----
# it looked like this may have included ": " in the annotation
: int
Only annotation
I can start a PR in a second, and definitely am happy to make any tweaks / changes! I realize the spec for the Returns section is a bit ambiguous, but the "no name or annotation" case seems particularly useful for just documenting the return type hint (maybe an issue similar in spirit to this one!: #137)
The text was updated successfully, but these errors were encountered:
Yeah, the Numpydoc spec comes short on these cases. It doesn't take into account that devs might annotate types in the signature and not in the docstring. I'm OK with supporting these additional cases. We should reach out to the style spec maintainers at some point. UPDATE: done: numpy/numpydoc#463
Describe the bug
For a numpy returns section, it seems like there may be some small issues with two cases:
":"
)": "
)Here's a docstring with comments trying to explain the two cases:
I can start a PR in a second, and definitely am happy to make any tweaks / changes! I realize the spec for the Returns section is a bit ambiguous, but the "no name or annotation" case seems particularly useful for just documenting the return type hint (maybe an issue similar in spirit to this one!: #137)
The text was updated successfully, but these errors were encountered: