Type hints for custom objects not linked
Open
Nobody has claimed this yet.
bug
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 146
- PR merge metrics
- No merged PRs in 30d
Description
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

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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the provided 20210409_pdoc.py example and pdoc3 20210409_pdoc.py --html. Trace how the generated documentation renders the Child annotations, then verify that custom-object type hints link to the documented class instead of displaying the filename.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100