Commit Graph

5 Commits

Author SHA1 Message Date
Takeshi KOMIYA
9a0a0f9ae1 Fix #8157: autodoc: TypeError is raised when annotation has 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.
2020-10-04 11:43:57 +09:00
Takeshi KOMIYA
b3b7cbbd38 Fix #7983: autodoc: Generator type annotation is wrongly rendered in py36
This adds a special handler (if-branch) for Generator type to stringify
them correctly.  So far, they have been considered as a kind of Callable.
2020-07-19 15:48:07 +09:00
Eric Wieser
46372726de Do not emit type arguments twice
Fixes gh-7567
2020-04-27 15:22:44 +01:00
Takeshi KOMIYA
34057601f4 Close #7165: autodoc: Support Annotated type (PEP-593) 2020-03-03 00:14:24 +09:00
Takeshi KOMIYA
05daa3c7ce Add sphinx.util.typing:stringify() to represent annotations as string 2020-01-05 01:13:27 +09:00