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 #8541: autodoc_type_aliases doesn't work for the instance attrs #8542

Merged
merged 4 commits into from
Dec 17, 2020

Conversation

tk0miya
Copy link
Member

@tk0miya tk0miya commented Dec 16, 2020

Feature or Bugfix

  • Bugfix

Purpose

…ce attrs

So far, autodoc obtains type annotations of instance attributes by
ModuleAnalyzer directly.  As a result, autodoc_type_aliases are ignored
for these variables.

This goes to merge type annotations from the class itself and
ModuleAnalyzer's, and get type annotations using `typing.get_type_hints()`
to apply autodoc_type_aliases.
@tk0miya tk0miya force-pushed the 8541_autodoc_type_aliases_for_ivar branch from be67cb1 to 55c110f Compare December 16, 2020 16:08
sphinx/ext/autodoc/__init__.py Outdated Show resolved Hide resolved
tests/test_ext_autodoc.py Show resolved Hide resolved
@tk0miya tk0miya merged commit beeab6c into sphinx-doc:3.x Dec 17, 2020
@tk0miya tk0miya deleted the 8541_autodoc_type_aliases_for_ivar branch December 17, 2020 13:12
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant