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
Attribute's are considered undocumented if described in the header #12230
Comments
Seems to be the exact same problem as explained in this post. In this case you have to think about both autodoc and napoleon working simultaneously and declaring the attributes twice in the rst. Arguably this isn't a bug but a feature, because the extensions are working as expected. |
That post has some good insight, thanks! I didn't really think of it that way. I can potentially use that exclude-members workaround in various scenarios, although not ideal. Doesn't this make the |
No! The
The main way to achieve that is by carefully setting the options in the autodoc directives. There could be use cases where you wanted to mix:
So that's 4 different ways that can coexist all at once, and Sphinx supports them simultaneously for flexibility and convenience.
This could make sense, to have both extensions interoperate to mark members as documented if napoleon parses them in the docstring sections. However, if in an exceptional case you wanted the opposite behavior (I have a hard time imagining a use case) it would be necessary to add an additional option to the directive. |
Describe the bug
Using autodoc, I am seeing that attributes are considered undocumented even if they are documented in the class header. This leads to duplicate entries as seen here:
An attribute should be considered documented if it's documented in the header.
How to Reproduce
index.rst file:
test_sphinx.py file:
Environment Information
Sphinx extensions
Additional context
No response
The text was updated successfully, but these errors were encountered: