sphinx-autoapi icon indicating copy to clipboard operation
sphinx-autoapi copied to clipboard

References to hidden members remain unresolved when a documented alternative exists

Open AWhetter opened this issue 6 months ago • 0 comments

Here is an example scenario:

# mypackage/__init__.py
from ._submodule import func, PublicClass
__all__ = ("func", "PublicClass")

# mypackage/_submodule.py
class PublicClass:
    pass

def func(a: PublicClass) -> bool:
    return True

In this scenario, AutoAPI currently documents mypackage.func as the following:

def func(a: mypackage._submodule.PublicClass) -> bool:
    ...

If mypackage._submodule.PublicClass is not documented, then the reference in the signature won't resolve and readers can't click though to the definition of the class. Ideally mypackage.func would be documented as follows so that the reference to PublicClass is resolved and is therefore a clickable link:

def func(a: mypackage.PublicClass) -> bool:
    ...

AWhetter avatar Jul 26 '24 03:07 AWhetter