mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #9384: autodoc_typehints='none' supports typehints for attributes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user