expose inherited_members to autosummary template

This commit is contained in:
Kenichi Maehashi 2018-06-01 13:29:00 +09:00
parent 98f10216c7
commit 270c1883e8
2 changed files with 7 additions and 0 deletions

View File

@ -205,6 +205,11 @@ The following variables available in the templates:
List containing names of all members of the module or class. Only available
for modules and classes.
.. data:: inherited_members
List containing names of all inherited members of class. Only available for
classes.
.. data:: functions
List containing names of "public" functions in the module. Here, "public"

View File

@ -203,6 +203,8 @@ def generate_autosummary_docs(sources, output_dir=None, suffix='.rst',
get_members(obj, 'exception', imported=imported_members)
elif doc.objtype == 'class':
ns['members'] = dir(obj)
ns['inherited_members'] = \
set(dir(obj)) - set(obj.__dict__.keys())
ns['methods'], ns['all_methods'] = \
get_members(obj, 'method', ['__init__'])
ns['attributes'], ns['all_attributes'] = \