Shorten long object names in type hint
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 146
- PR merge metrics
- No merged PRs in 30d
Description
In my source, I have object that are defined very deep into the hierarchy. In Sphinx, I can use ~ to just output the name of the class, not the entire path.
Expected Behavior
def add(self, from_component: Component, to_component)
Actual Behavior
def add(self, from_component: components.stdlib.component.Component, to_component)
Steps to Reproduce
- Nest an object's definition deeply
- Use it in a typehint
Additional info
- pdoc version: pdoc3 0.6.3
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
Reproduce the issue with an object defined deeply in a Python module hierarchy and used in a type hint, using the pdoc3 0.6.3 behavior described here. Compare the generated signature with the expected shortened class name, and consider the work complete when long qualified names are displayed in shortened form without losing the type reference.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100