sphinx-doc / sphinx-doc/sphinx
`MappingProxyType[A, B]` rendered as `MappingProxyType`
Open
Nobody has claimed this yet.
internals:typing
type:regression
- Dominant language
- Python
- Stars
- 8k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Hello,
I'm not at all sure where I should open this issue, but I think sphinx might be the right place.
When documenting a propery with .. autoproperty::, look at the two cases below.
How to Reproduce
With dict: no problem
@property
def myproperty(self) -> dict[str, int]:
...
renders as
With MappingProxyType: problem
@property
def myproperty(self) -> MappingProxyType[str, int]:
...
renders as
I would expect MappingProxyType[str, int] render.
Environment Information
Created using [Sphinx](https://www.sphinx-doc.org/) 8.2.3
Built with the [PyData Sphinx Theme](https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html) 0.16.1.
Using python 3.13
Ubuntu 22.04
Sphinx extensions
extensions = [
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinxcontrib.bibtex",
]
├── sphinx v8.2.3 (group: dev) (*)
└── sphinxcontrib-bibtex v2.6.4a1 (group: dev) (*)
Additional context
No response
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 Sphinx 8.2.3 using .. autoproperty:: and the MappingProxyType[str, int] annotation, comparing it with dict[str, int]. Start by tracing Sphinx's autoproperty type-annotation rendering; done means the rendered documentation preserves the MappingProxyType generic arguments.
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
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100