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

A type hint for the instance variable defined at parent class is not shown in the document of the derived class. #8032

Closed
tk0miya opened this issue Aug 1, 2020 · 0 comments

Comments

@tk0miya
Copy link
Member

tk0miya commented Aug 1, 2020

Describe the bug
A type hint for the instance variable defined at parent class is not shown in the document of the derived class.

To Reproduce

# example.py
class Foo:
    var1: int

    def meth(self):
        pass


class Bar(Foo):
    pass
# index.rst
.. automodule:: example
   :members:
   :undoc-members:
   :inherited-members:

Output:
スクリーンショット 2020-08-01 21 48 48

Expected behavior
A type hint is shown.

Your project
No

Screenshots
No

Environment info

  • OS: Mac
  • Python version: 3.8.2
  • Sphinx version: HEAD of 3.x
  • Sphinx extensions: sphinx.ext.autodoc
@tk0miya tk0miya added this to the 3.2.0 milestone Aug 1, 2020
@tk0miya tk0miya changed the title <what happen when you do on which document project> A type hint for the instance variable defined at parent class is not shown in the document of the derived class. Aug 1, 2020
tk0miya added a commit to tk0miya/sphinx that referenced this issue Aug 1, 2020
…hown

This tries to import the parent object for the instance attribute
to get type annotations for the variable.
@tk0miya tk0miya closed this as completed in 5d301b4 Aug 2, 2020
tk0miya added a commit that referenced this issue Aug 2, 2020
…tclass

Fix #8032: autodoc: A typehint for inherited ivars is not shown
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 21, 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