Skip to content

Inherited members showing up inappropriately #102

@analog-cbarber

Description

@analog-cbarber

Using mkdocstrings-python 1.5.2 w/ griffe 0.35, we noticed that suddenly inherited members
started showing up in our API docs although we did not ask for them. They show up even
when explicitly turned off.

Our code is internal, so I cannot share it, but I did some poking into do_filter_objects
and found that the offending members are aliases whose target is inherited. This hack
in do_filter_objects appears to mimic the old behavior:

    if members_list is True:
        # Return all pre-selected members.
        return objects

    # HACK - remove inherited aliases
    from griffe.dataclasses import Alias
    for i in reversed(range(len(objects))):
        obj = objects[i]
        if isinstance(obj,Alias):
            assert not obj.inherited
            if obj.target.inherited:
                objects.pop(i)

Hope that is enough to go on....

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