Skip to content

class members are not listed when class is an ABC #52

@jairideout

Description

@jairideout

If a class derives from an ABC using the abc module, its members are not included in the generated autosummary RST (regardless of whether the derived class is abstract or concrete at runtime).

This happens because the abc module always sets empty __slots__ on abstract classes, and __slots__ take precedence over the class __dict__ when automodsumm searches for class members (see these lines). Thus, any class with an ABC in its inheritance chain will have an empty __slots__ attribute (unless other classes have added attributes to __slots__ along the way).

I'll have a PR in shortly with a minimal unit test case that reproduces the issue, and will include a potential fix.

The issue was originally discovered here: sunpy/sunpy#2348

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