-
Notifications
You must be signed in to change notification settings - Fork 131
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
Ignore inherited docstring #240
Comments
This seems like a reasonable suggestion to me. You're right that setting |
To any new contributors looking to implement this issue, the sphinx-autoapi/autoapi/extension.py Line 282 in 5bb4ff2
|
Hi, I have taken a look at this issue. During the effort to reproduce said issue with integration tests, I have discovered the following:
Based on the above I have came to the conclusion that the issue can be prevented by adding
Now my question is: should ignoring |
Thank you for looking into it @attilaviniczai. I think ignoring One more thing I'd add, is that when inheriting from Exceptions a similar behaviour is present, yet they don't inherit from neither |
Thanks @AWhetter! 👏 |
Is there any way to prevent inheriting docstrings? This was introduced in fca36aa based on #203, yet there are cases when this is an unwanted behaviour.
When inheriting some simple classes the resulting doc contains an unwanted docstring that's inherited:
Will generate the following doc:
That last line is unnecessary and misleading. It is brought in from the Python builtin
type.__new__
and is displayed in all objects that don't contain a bespoke__init__
or__new__
with a docstring.I'm guessing that this behaviour could be prevented by configuring the autoapi_python_class_content to
class
, but I wouldn't want to do that given that elsewhere I define all of my docstrings in__init__
sWould be amazing if there was a configuration option in autoapi_options that could prevent this behaviour. Even more so - it would be ideal if there was some local pragma that could be added to a docstring that would prevent this on case-by-case basis, such as:
Autoapi: 1.4.0
Python: 3.7
(btw. thanks for this incredible library! Really well done!)
The text was updated successfully, but these errors were encountered: