Skip to content

autosummary -- does not understand module level datas/attributes #344

@shimizukawa

Description

@shimizukawa

Let's take following code:

#!python

"""Submodule"""
class SomeOther(object):
    """Some other class"""
    pass

ATTRIBUTE_OF_SUBMODULE = True
"""This is attribute of submodule, of type boolean"""

OTHER_ATTRIBUTE_OF_SUBMODULE = SomeOther()
"""This is *other* attribute of type :class:`SomeClass`"""

Now if I do autosummary for the module like this:

.. automodule:: submodule

.. autosummary::

    ATTRIBUTE_OF_SUBMODULE
    OTHER_ATTRIBUTE_OF_SUBMODULE
    SomeOther

Autosummary table contains incorrect entries for attributes/datas of module:

ATTRIBUTE_OF_SUBMODULE  bool(x) -> bool 
OTHER_ATTRIBUTE_OF_SUBMODULE    Some other class

Underlying autodocumentor in other hand works correctly, since directive autodata gets the documentation string from attributes/datas of module correctly.


Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions