fix(docs): stop rendering duplicate parameter type hints in the API reference - #67
Open
dhedey wants to merge 1 commit into
Open
fix(docs): stop rendering duplicate parameter type hints in the API reference#67dhedey wants to merge 1 commit into
dhedey wants to merge 1 commit into
Conversation
conf.py enables both core autodoc's `autodoc_typehints = "description"` and the sphinx-autodoc-typehints extension. Both render type hints into the parameter descriptions, so every parameter in the API reference appeared twice — once with its description (from the extension, honoring `typehints_description_target = "documented_params"`) and once as a bare type (from core autodoc, whose target defaults to "all"). Set `autodoc_typehints = "none"` so the extension is the sole renderer. On the API reference page this drops the parameter list from 273 entries to 114, with every parameter keeping its description and merged type, and no bare duplicates. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dhedey
requested review from
ethanwharris,
justusschock,
owbone and
tchaton
as code owners
July 28, 2026 12:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
docs/source/conf.pyenables two type-hint renderers at once:autodoc_typehints = "description", andsphinx_autodoc_typehintsextension (withtypehints_description_target = "documented_params").Both inject type hints into the parameter descriptions, so every parameter in the API reference renders twice — once with its description and merged type (from the extension), and once as a bare type-only entry (from core autodoc, whose own target defaults to
"all").Fix
Set
autodoc_typehints = "none"so the extension is the sole renderer. The extension already handles this correctly and honorsdocumented_params.Effect
Built against the docs toolchain (
--group docs, Sphinx 8.2), on the API reference page:Each parameter now appears once, keeping its description with the type merged in, e.g.:
Returns/Return typefields are unaffected.