Fix #9384: autodoc_typehints='none' supports typehints for attributes

This commit is contained in:
Takeshi KOMIYA
2021-06-29 21:48:19 +09:00
parent b187ca0951
commit 2aef00d7bd
4 changed files with 65 additions and 11 deletions

View File

@@ -1,5 +1,8 @@
from typing import Any, Tuple, Union
CONST1: int
CONST2: int = 1
def incr(a: int, b: int = 1) -> int:
return a + b
@@ -11,6 +14,9 @@ def decr(a, b = 1):
class Math:
CONST1: int
CONST2: int = 1
def __init__(self, s: str, o: Any = None) -> None:
pass
@@ -32,6 +38,10 @@ class Math:
# type: (...) -> None
return
@property
def prop(self) -> int:
return 0
def tuple_args(x: Tuple[int, Union[int, str]]) -> Tuple[int, int]:
pass