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

Fix #8460: autodoc: Support custom types defined by typing.NewType #8465

Merged
merged 5 commits into from
Nov 22, 2020

Conversation

tk0miya
Copy link
Member

@tk0miya tk0miya commented Nov 21, 2020

Feature or Bugfix

  • Feature

Purpose

  • A custom type defined by typing.NewType was rendered as a function
    because the generated type is a function having special attributes.
    This renders it as a variable.

  • Note: The module name where the NewType object defined is lost on
    generating it. So it is hard to make cross-reference for these custom
    types.

@tk0miya tk0miya added type:enhancement enhance or introduce a new feature extensions:autodoc labels Nov 21, 2020
@tk0miya tk0miya added this to the 3.4.0 milestone Nov 21, 2020
tests/test_ext_autodoc.py Outdated Show resolved Hide resolved
…NewType

A custom type defined by typing.NewType was rendered as a function
because the generated type is a function having special attributes.
This renders it as a variable.

Note: The module name where the NewType object defined is lost on
generating it.  So it is hard to make cross-reference for these custom
types.
Separate NewType feature from DataDocumenter to mixin class to share it
with another Documenter.
@tk0miya tk0miya merged commit 24a329e into sphinx-doc:3.x Nov 22, 2020
@tk0miya tk0miya deleted the 8460_NewType branch November 22, 2020 04:47
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 20, 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 this pull request may close these issues.

None yet

1 participant