sphinx-autoapi icon indicating copy to clipboard operation
sphinx-autoapi copied to clipboard

Inherited attributes are ignored

Open timokau opened this issue 4 years ago • 3 comments

AutoAPI currently does not show inherited attributes, even if the :inherited-members: option is set. Previously discussed here: https://github.com/readthedocs/sphinx-autoapi/issues/183#issuecomment-802907384

CC @AWhetter

timokau avatar Mar 22 '21 10:03 timokau

To any newcomers looking to resolve this issue, the parser currently retrieves the attributes of base classes in this for loop:

https://github.com/readthedocs/sphinx-autoapi/blob/7872ed00b0c8052d13372b2ec2bddf237dbfc60c/autoapi/mappers/python/parser.py#L126

The loop will need to check if it is looking at the __init__ function of a base class and if it is then look at the children of the function for attributes that get assigned to.

For the documentation of attributes to be inherited, the attribute itself will need a docstring. We cannot parse out the attribute documentation from an attributes list in the class docstring.

AWhetter avatar Mar 25 '21 04:03 AWhetter

is there any update on this issue ?

amirhessam88 avatar Sep 04 '22 03:09 amirhessam88

I think this issue is fixed now? or at least I dont see the problem anymore on my end. The most important point is to avoid having circular imports when you inherit from another class

amirhessam88 avatar Sep 30 '22 06:09 amirhessam88