pdoc icon indicating copy to clipboard operation
pdoc copied to clipboard

Type hints for custom objects not linked

Open cgebbe opened this issue 4 years ago • 1 comments

Expected Behavior

File called 20210409_pdoc.py

class Child:
    def __init__(self, name: str ="child"):
        """
        One child description

        Args:
            name: name of child
        """
        self.name: str = name



class Parent:
    cls_child: Child = Child("name of cls child")

    def __init__(self, child: Child = None):
        """
        Parent object

        Args:
            child: child instance
        """
        self.child: Child = child

Running pdoc3 20210409_pdoc.py --html yields

image

Ideally, the type hints would be links to the actual class.

Actual Behavior

No links, but instead the filename is printed

Additional info

  • pdoc version: pdoc3 0.9.2

cgebbe avatar Apr 09 '21 12:04 cgebbe

Curiously, it works if I rename the file so it doesn't start with numbers:

mv 20210409_pdoc.py test_hints.py

:thinking:

kernc avatar Apr 09 '21 13:04 kernc