Skip to content

Add fix for #296#297

Merged
gaborbernat merged 9 commits into
tox-dev:mainfrom
hoodmane:overloads
Jan 17, 2023
Merged

Add fix for #296#297
gaborbernat merged 9 commits into
tox-dev:mainfrom
hoodmane:overloads

Conversation

@hoodmane

@hoodmane hoodmane commented Jan 17, 2023

Copy link
Copy Markdown
Collaborator

See the explanation in the diff and in issue #296.

Resolves #296.

@hoodmane

Copy link
Copy Markdown
Collaborator Author

Well that doesn't seem to work...

@gaborbernat gaborbernat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll need to fix the CI 🤔

@gaborbernat

Copy link
Copy Markdown
Member

Almost just need to fix CI on 3.7 and 3.8!

@gaborbernat
gaborbernat merged commit 2cea8d4 into tox-dev:main Jan 17, 2023
@hoodmane
hoodmane deleted the overloads branch January 17, 2023 18:07
@flying-sheep flying-sheep mentioned this pull request Mar 11, 2025
gaborbernat added a commit to gaborbernat/sphinx-autodoc-typehints that referenced this pull request Feb 23, 2026
PR tox-dev#297 disabled overload detection to work around Sphinx not emitting
autodoc-process-signature events for overloaded functions. However, this
removed valuable type information from documentation, as users with complex
overloaded APIs lost their distinct signature variants.

Sphinx 9's directive-based architecture now handles overloads natively with
proper signature rendering. By removing the overload-clearing workaround,
all overload variants appear in documentation with their specific type
signatures intact, giving users complete type information for overloaded
functions.

Resolves tox-dev#529
gaborbernat added a commit to gaborbernat/sphinx-autodoc-typehints that referenced this pull request Feb 24, 2026
PR tox-dev#297 disabled overload signatures to avoid Sphinx architectural issues where
autodoc-process-signature events don't fire for overloads. This removed valuable
type information from documentation for functions with multiple type signatures.

Instead of showing overloads in signature lines (where types can't be cross-referenced),
cache them during analysis and render them in docstrings as a formatted field list.
This gives each overload variant with properly cross-referenced types while avoiding
the architectural limitations.

Functions with @overload decorators now show:
  Overloads:
    * param (int) → str
    * param (list[int]) → dict[str, int]

All types are cross-referenced and clickable in HTML output. Generic return types
are suppressed when overloads are present since each variant already shows its
specific return type.

Resolves tox-dev#529
gaborbernat added a commit that referenced this pull request Feb 24, 2026
* ✨ feat(signatures): render overloads in docstrings with type formatting

PR #297 disabled overload signatures to avoid Sphinx architectural issues where
autodoc-process-signature events don't fire for overloads. This removed valuable
type information from documentation for functions with multiple type signatures.

Instead of showing overloads in signature lines (where types can't be cross-referenced),
cache them during analysis and render them in docstrings as a formatted field list.
This gives each overload variant with properly cross-referenced types while avoiding
the architectural limitations.

Functions with @overload decorators now show:
  Overloads:
    * param (int) → str
    * param (list[int]) → dict[str, int]

All types are cross-referenced and clickable in HTML output. Generic return types
are suppressed when overloads are present since each variant already shows its
specific return type.

Resolves #529

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Doesn't interact correctly with typing.overload.

2 participants