Navigation Menu

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

Unexpected "alias of" in attributes generated by autodoc. #9218

Closed
Abrosimov-a-a opened this issue May 12, 2021 · 0 comments
Closed

Unexpected "alias of" in attributes generated by autodoc. #9218

Abrosimov-a-a opened this issue May 12, 2021 · 0 comments
Labels
Milestone

Comments

@Abrosimov-a-a
Copy link

Describe the bug
Handmaded docstrings for attributes are ignored by sphinx autodoc and replaced by alias of.

To Reproduce

  1. Create default sphinx project with autodoc extension.
  2. Create example_code.py with content:
from typing import Union, Type

class MyClass:
    """Class ``MyClass`` docstring."""

    #: This comment is not displayed.
    int_attr = int
    #: This comment is not displayed.
    typed_attr: Union[Type[int], Type[str]] = int
  1. Build html documenation for example_code.py.

Expected behavior
I expect to see This comment is not displayed. docstring for int_attr and typed_attr attributes,
but I see alias of int docstring.

Environment info

  • OS: Linux Debian Buster
  • Python version: 3.7.3
  • Sphinx version: v3.2.1, v3.5.4
  • Sphinx extensions: sphinx.ext.autodoc

Additional context
Possibly related:

tk0miya added a commit to tk0miya/sphinx that referenced this issue May 15, 2021
@tk0miya tk0miya added extensions:autodoc type:proposal a feature suggestion and removed type:bug labels May 15, 2021
@tk0miya tk0miya added this to the 4.1.0 milestone May 15, 2021
tk0miya added a commit to tk0miya/sphinx that referenced this issue May 15, 2021
tk0miya added a commit to tk0miya/sphinx that referenced this issue May 15, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants