-
-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Is include the _str_signature
necessary in the __str__
#190
Comments
No, if the original docstring contained the signature also the formatted one needs to contain it. |
I guess the question relates to roundtripping (PR #189): # Signature example
from numpydoc.docscrape import FunctionDoc
def foo(bar='baz'):
"""foo does foo-like stuff
Parameters
----------
bar : str
bar like stufff
"""
return bar
doc = FunctionDoc(foo)
print(str(doc)) output:
I expected it to return something like the original doc-string I typed in. I understand if this isn't the desired usecase of numpydoc. I understand if this |
Perhaps --- however, please keep in mind that numpydoc has a single task that it is meant to do, generating Sphinx-formatted docstrings from Numpy-format ones, and any changes should not cause regressions to this functionality. |
Got it. I'll keep that in mind when I try to think of a good way to integrate this kind of functionality. |
numpydoc/numpydoc/docscrape.py
Line 471 in 659e43f
It doesn't seem natural for one to write their own signature. I would think that the
str(NumpyDocString)
would return the same thing that one would type themselves.Can we take out the
_str_signature
?Once again, this is in reference to designing a solution for:
#67 (comment)
Otherwise, one would need an other function that doesn't include the
_str_signature()
line.The text was updated successfully, but these errors were encountered: