7
7
from collections import defaultdict
8
8
from typing import TYPE_CHECKING , Any , Sequence
9
9
10
- from griffe .enumerations import ParameterKind
11
- from griffe .expressions import Expr , ExprCall , ExprSubscript , ExprTuple
10
+ from griffe import Expr , ExprCall , ExprSubscript , ExprTuple , ParameterKind
12
11
13
12
from griffe_typingdoc ._docstrings import (
14
13
_no_self_params ,
@@ -213,7 +212,7 @@ def _warns_docs(attr_or_func: Attribute | Function, **kwargs: Any) -> DocstringS
213
212
if attr_or_func .is_attribute :
214
213
annotation = attr_or_func .annotation
215
214
elif attr_or_func .is_function :
216
- annotation = attr_or_func .returns # type: ignore[union-attr]
215
+ annotation = attr_or_func .returns
217
216
metadata = _metadata (annotation )
218
217
if metadata ["warns" ]:
219
218
return _to_warns_section ({"annotation" : warned [0 ], "description" : warned [1 ]} for warned in metadata ["warns" ])
@@ -224,7 +223,7 @@ def _raises_docs(attr_or_func: Attribute | Function, **kwargs: Any) -> Docstring
224
223
if attr_or_func .is_attribute :
225
224
annotation = attr_or_func .annotation
226
225
elif attr_or_func .is_function :
227
- annotation = attr_or_func .returns # type: ignore[union-attr]
226
+ annotation = attr_or_func .returns
228
227
metadata = _metadata (annotation )
229
228
if metadata ["raises" ]:
230
229
return _to_raises_section ({"annotation" : raised [0 ], "description" : raised [1 ]} for raised in metadata ["raises" ])
@@ -238,7 +237,7 @@ def _deprecated_docs(
238
237
if attr_or_func .is_attribute :
239
238
annotation = attr_or_func .annotation
240
239
elif attr_or_func .is_function :
241
- annotation = attr_or_func .returns # type: ignore[union-attr]
240
+ annotation = attr_or_func .returns
242
241
metadata = _metadata (annotation )
243
242
if "deprecated" in metadata :
244
243
return _to_deprecated_section ({"description" : metadata ["deprecated" ]})
0 commit comments