Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

References to builtins not working in autodoc class aliases #8493

Closed
timobrembeck opened this issue Nov 26, 2020 · 0 comments · Fixed by #8494
Closed

References to builtins not working in autodoc class aliases #8493

timobrembeck opened this issue Nov 26, 2020 · 0 comments · Fixed by #8494
Labels
extensions:autodoc type:enhancement enhance or introduce a new feature
Milestone

Comments

@timobrembeck
Copy link
Contributor

timobrembeck commented Nov 26, 2020

Describe the bug
When aliasing an attribute to another class, sphinx adds the line "alias of ..." to the attribute's documentation.
If the other class is a builtin, this adds e.g.:

alias of :class:`builtins.dict`

However, the intersphinx mapping to the official Python documentation only works without the "builtins"-part in the module path.

When using the nit-picky mode of sphinx, this results in the following warning:

WARNING: py:class reference target not found: builtins.int

To Reproduce
There's a test case which shows this behaviour.

Expected behavior
I expect the autodoc extension to generate the correct links suited for intersphinx mappings:

alias of :class:`dict`

Environment info

  • OS: Arch Linux
  • Python version: 3.7.9 & 3.8.6
  • Sphinx version: 3.3.1
  • Sphinx extensions: sphinx.ext.autodoc
  • Extra tools: None

Additional context
I think it makes sense to use the utilitiy function restify for this. I will provide a patch soon.

timobrembeck added a commit to timobrembeck/sphinx that referenced this issue Nov 26, 2020
@tk0miya tk0miya added this to the 3.4.0 milestone Nov 28, 2020
@tk0miya tk0miya added type:enhancement enhance or introduce a new feature and removed type:bug labels Nov 28, 2020
timobrembeck added a commit to timobrembeck/sphinx that referenced this issue Nov 28, 2020
timobrembeck added a commit to timobrembeck/sphinx that referenced this issue Nov 28, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
extensions:autodoc type:enhancement enhance or introduce a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants