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

Property annotations do not show up in autoclass #7383

Closed
eric-wieser opened this issue Mar 26, 2020 · 3 comments
Closed

Property annotations do not show up in autoclass #7383

eric-wieser opened this issue Mar 26, 2020 · 3 comments

Comments

@eric-wieser
Copy link
Contributor

The following code renders the annotation on the method but not the property:

class Foo:
    @property
    def prop(self) -> int:
        """ the prop """
    def get_prop(self) -> int:
        """ get the prop """
.. autoclass:: Foo
    :members:

Expected output:

Foo
    property prop -> int
        the prop

    get_prop() -> int
        get the prop

actual output

Foo
    property prop
        the prop

    get_prop() -> int
        get the prop

Environment info

  • OS: Win
  • Python version: 3.8
  • Sphinx version: 3.0.0b1
  • Sphinx extensions: sphinx.ext.autodoc
@eric-wieser
Copy link
Contributor Author

Patch linked above, this was fairly straightforward.

@pavel-kirienko
Copy link

Are there plans to have this addressed in the near future? Is anybody working on this? Thanks.

@tk0miya
Copy link
Member

tk0miya commented Aug 21, 2020

I posted #7298 to implement it. But it was perfectly stalled. I don't have idea to go forward.

@tk0miya tk0miya modified the milestones: 3.3.0, 3.4.0 Oct 3, 2020
@tk0miya tk0miya modified the milestones: 3.4.0, 3.5.0 Dec 19, 2020
@tk0miya tk0miya modified the milestones: 3.5.0, 4.0.0 Feb 4, 2021
tk0miya added a commit to tk0miya/sphinx that referenced this issue Mar 11, 2021
py:property directive now outputs py:property directive to describe
its type annotation.
tk0miya added a commit to tk0miya/sphinx that referenced this issue Mar 13, 2021
py:property directive now outputs py:property directive to describe
its type annotation.
tk0miya added a commit to tk0miya/sphinx that referenced this issue Mar 13, 2021
py:property directive now outputs py:property directive to describe
its type annotation.
tk0miya added a commit that referenced this issue Mar 15, 2021
Fix #7383: autodoc: Support typehints for properties
@tk0miya tk0miya closed this as completed Mar 15, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 13, 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

3 participants