-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 inherited-members won't work for inherited attributes (data members). #741
Comments
From mitar on 2012-01-07 18:21:47+00:00 Also {{{find_attr_doc}}} seems to not find inherited attributes? |
From mitar on 2012-01-07 20:04:22+00:00 The problem is also that parser for attributes' doc strings parses only one module. It should also parses modules of all parent classes and combine everything. |
From Jon Waltman on 2012-11-30 15:14:18+00:00 Issue #1048 was marked as a duplicate of this issue. |
I'm currently getting bit by this issue in 1.2.3. #2233 is preventing me from working with |
Is there any hope of getting this fixed, or a workaround? As mentioned in #1048 even using autoattribute does not work. |
I'm also running into this. For now I'm manually duplicating docstrings, but it would be nice if I'm not familiar with the code base at all, but if anyone's willing to point me in a direction I can try to write a fix. |
Any news on this feature / bugfix ? |
This is a workaround for sphinx-doc/sphinx#741
…ce attributes on super class To support instance attributes on super class, get_class_members() scans the instance attributes defined at super classes using ModuleAnalyzer. It allows to generate document for them when users gives : inherited-members: option.
Fix #741: autodoc: inherited-members doesn't support instance attributes on super class
I saw that #8548 was merged and released inside sphinx 3.4.0. But a simple class A(object):
def __init__(self):
self.a = a
r"""My first attribute."""
class B(A):
def __init__(self):
self.b = b
r"""My second attribute.""" .. automodule:: abtest
.. autoclass:: B
:members:
:inherited-members: |
…ce attributes on super class To support instance attributes on super class, get_class_members() scans the instance attributes defined at super classes using ModuleAnalyzer. It allows to generate document for them when users gives :inherited-members: option. It was fixed once, but it only works on test script because :inherited-members: option is recognized as expected on running Sphinx from command line. This fixes the option_spec handler and autodoc itself.
…ce attributes on super class To support instance attributes on super class, get_class_members() scans the instance attributes defined at super classes using ModuleAnalyzer. It allows to generate document for them when users gives :inherited-members: option. It was fixed once, but it only works on test script because :inherited-members: option is recognized as expected on running Sphinx from command line. This fixes the option_spec handler and autodoc itself. refs: sphinx-doc#8548
Fix #741: autodoc: inherited-members doesn't support instance attributes on super class
autodoc searches for a cached docstring using (namespace, attrname) as search-key, but doesn't check for baseclass-namespace.
The text was updated successfully, but these errors were encountered: