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 #8157: autodoc: TypeError is raised when annotation has invalid __args__ #8264

Merged
merged 1 commit into from Oct 4, 2020

Conversation

tk0miya
Copy link
Member

@tk0miya tk0miya commented Oct 2, 2020

Feature or Bugfix

  • Bugfix

Purpose

  • refs: TypeError: 'type' object is not iterable #8157

  • Typically, the args attribute of type annotations is a tuple
    containing arguments for the types (ex. The args of List[int] is
    (int,)). But some kind of types has non tuple args attribute.
    For example, nptyping.NDArray is one of them.

  • This fixes the TypeError when the invalid args attribute found.

@tk0miya tk0miya added this to the 3.3.0 milestone Oct 2, 2020
@tk0miya tk0miya force-pushed the 8157_TypeError_for_invalid_args branch 3 times, most recently from eee1557 to 8268e69 Compare October 4, 2020 02:39
… invalid __args__

Typically, the __args__ attribute of type annotations is a tuple
containing arguments for the types (ex. The __args__ of `List[int]` is
`(int,)`).  But some kind of types has non tuple __args__ attribute.
For example, `nptyping.NDArray` is one of them.

This fixes the TypeError when the invalid __args__ attribute found.
@tk0miya tk0miya force-pushed the 8157_TypeError_for_invalid_args branch from 8268e69 to 9a0a0f9 Compare October 4, 2020 02:44
sphinx/util/typing.py Outdated Show resolved Hide resolved
@tk0miya tk0miya merged commit b428cd2 into sphinx-doc:3.x Oct 4, 2020
@tk0miya tk0miya deleted the 8157_TypeError_for_invalid_args branch October 4, 2020 02:52
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 23, 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