Skip to content

:include-all-objects: does not include instance variables. #66

@mjstahlberg

Description

@mjstahlberg

If I document instance variables as follows

class A:
    def __init__(self):
        self.a = None
        """Documented instance variable."""

then they do not show up in the attributes section (or anywhere at all) of the class documentation pages generated by automodapi, even with :include-all-objects:.

It would be ideal to find them in the attributes section, together with the properties and the class variables, as the user is not supposed to be able to distinguish between those three types (after all property's job is to make the user think they are dealing with variables while really they are using functions).

Note that there seems to be an undocumented autoinstanceattribute keyword that might be useful.

(If I use the alternative approach of putting :ivar a: Documented instance variable. in the class' docstring then they appear as part of the class documentation in an info field list but they cannot be referenced, i.e. :py:obj:'a' does not find its target.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions