Skip to content
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

autodoc: The annotation only member in superclass is treated as "undocumented" #8800

Closed
tk0miya opened this issue Jan 31, 2021 · 0 comments
Closed

Comments

@tk0miya
Copy link
Member

tk0miya commented Jan 31, 2021

Describe the bug
autodoc: The annotation only member in superclass is treated as "undocumented".

To Reproduce

# example.py
class Foo:
    """docstring"""
    attr1: int  #: docstring


class Bar(Foo):
    """docstring"""
    attr2: str  #: docstring
# index.rst
.. autoclass:: example.Bar
   :members:
   :inherited-members:

Bar.attr1 is not documented. It will be shown if I give :undoc-members: option to the autoclass directive call. It seems the attribute is treated as undocumented.

Expected behavior
It should be shown.

Your project
No

Screenshots
No

Environment info

  • OS: Mac
  • Python version: 3.9.1
  • Sphinx version: HEAD of 3.x
  • Sphinx extensions: sphinx.ext.autodoc
  • Extra tools: No

Additional context
No

@tk0miya tk0miya added this to the 3.5.0 milestone Jan 31, 2021
tk0miya added a commit to tk0miya/sphinx that referenced this issue Jan 31, 2021
…are recognized as undocumented

Unintentionally, uninitialized attributes defined at superclasses are
recognized as undocumented in the filtering step.  Therefore, they are
filtered if `:undoc-members:` option given.
tk0miya added a commit to tk0miya/sphinx that referenced this issue Jan 31, 2021
…are recognized as undocumented

Unintentionally, uninitialized attributes defined at superclasses are
recognized as undocumented in the filtering step.  Therefore, they are
filtered if `:undoc-members:` option given.
@tk0miya tk0miya closed this as completed in 6d8c918 Feb 1, 2021
tk0miya added a commit that referenced this issue Feb 1, 2021
…d_attribute_on_superclass_ignored

Fix #8800: autodoc: Uninitialized attributes in superclass are recognized as undocumented
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant