@@ -106,7 +106,7 @@ def _attribute_docs(attr: Attribute, **kwargs: Any) -> str: # noqa: ARG001
106106def _parameters_docs (func : Function , ** kwargs : Any ) -> DocstringSectionParameters | None : # noqa: ARG001
107107 params_data : dict [str , dict [str , Any ]] = defaultdict (dict )
108108 for parameter in _no_self_params (func ):
109- stars = {ParameterKind .var_positional : "*" , ParameterKind .var_keyword : "**" }.get (parameter .kind , "" ) # type: ignore[arg-type]
109+ stars = {ParameterKind .var_positional : "*" , ParameterKind .var_keyword : "**" }.get (parameter .kind , "" )
110110 param_name = f"{ stars } { parameter .name } "
111111 metadata = _metadata (parameter .annotation )
112112 if "deprecated" in metadata or "doc" in metadata :
@@ -126,12 +126,12 @@ def _other_parameters_docs(func: Function, **kwargs: Any) -> DocstringSectionPar
126126 "typing.Annotated" ,
127127 "typing_extensions.Annotated" ,
128128 }:
129- annotation = annotation .slice .elements [0 ] # type: ignore[union-attr]
129+ annotation = annotation .slice .elements [0 ]
130130 if isinstance (annotation , ExprSubscript ) and annotation .canonical_path in {
131131 "typing.Unpack" ,
132132 "typing_extensions.Unpack" ,
133133 }:
134- slice_path = annotation .slice .canonical_path # type: ignore[union-attr]
134+ slice_path = annotation .slice .canonical_path
135135 typed_dict = func .modules_collection [slice_path ]
136136 params_data = {
137137 attr .name : {"annotation" : attr .annotation , "description" : description }
@@ -150,13 +150,13 @@ def _yields_docs(func: Function, **kwargs: Any) -> DocstringSectionYields | None
150150
151151 if isinstance (annotation , ExprSubscript ):
152152 if annotation .canonical_path in {"typing.Generator" , "typing_extensions.Generator" }:
153- yield_annotation = annotation .slice .elements [0 ] # type: ignore[union-attr ]
153+ yield_annotation = annotation .slice .elements [0 ] # ty: ignore[unresolved-attribute ]
154154 elif annotation .canonical_path in {"typing.Iterator" , "typing_extensions.Iterator" }:
155155 yield_annotation = annotation .slice
156156
157157 if yield_annotation :
158158 if isinstance (yield_annotation , ExprSubscript ) and yield_annotation .is_tuple :
159- yield_elements = yield_annotation .slice .elements # type: ignore[union-attr ]
159+ yield_elements = yield_annotation .slice .elements # ty: ignore[unresolved-attribute ]
160160 else :
161161 yield_elements = [yield_annotation ]
162162 yield_data = [
@@ -178,11 +178,11 @@ def _receives_docs(func: Function, **kwargs: Any) -> DocstringSectionReceives |
178178 "typing.Generator" ,
179179 "typing_extensions.Generator" ,
180180 }:
181- receive_annotation = annotation .slice .elements [1 ] # type: ignore[union-attr ]
181+ receive_annotation = annotation .slice .elements [1 ] # ty: ignore[unresolved-attribute ]
182182
183183 if receive_annotation :
184184 if isinstance (receive_annotation , ExprSubscript ) and receive_annotation .is_tuple :
185- receive_elements = receive_annotation .slice .elements # type: ignore[union-attr]
185+ receive_elements = receive_annotation .slice .elements
186186 else :
187187 receive_elements = [receive_annotation ]
188188 receive_data = [
@@ -204,7 +204,7 @@ def _returns_docs(func: Function, **kwargs: Any) -> DocstringSectionReturns | No
204204 "typing.Generator" ,
205205 "typing_extensions.Generator" ,
206206 }:
207- return_annotation = annotation .slice .elements [2 ] # type: ignore[union-attr ]
207+ return_annotation = annotation .slice .elements [2 ] # ty: ignore[unresolved-attribute ]
208208 elif isinstance (annotation , ExprSubscript ) and annotation .canonical_path in {
209209 "typing.Annotated" ,
210210 "typing_extensions.Annotated" ,
@@ -213,7 +213,7 @@ def _returns_docs(func: Function, **kwargs: Any) -> DocstringSectionReturns | No
213213
214214 if return_annotation :
215215 if isinstance (return_annotation , ExprSubscript ) and return_annotation .is_tuple :
216- return_elements = return_annotation .slice .elements # type: ignore[union-attr ]
216+ return_elements = return_annotation .slice .elements # ty: ignore[unresolved-attribute ]
217217 else :
218218 return_elements = [return_annotation ]
219219 return_data = [
@@ -231,7 +231,7 @@ def _warns_docs(attr_or_func: Attribute | Function, **kwargs: Any) -> DocstringS
231231 if attr_or_func .is_attribute :
232232 annotation = attr_or_func .annotation
233233 elif attr_or_func .is_function :
234- annotation = attr_or_func .returns # type: ignore[union-attr ]
234+ annotation = attr_or_func .returns # ty: ignore[unresolved-attribute ]
235235 else :
236236 return None
237237 metadata = _metadata (annotation )
@@ -244,7 +244,7 @@ def _raises_docs(attr_or_func: Attribute | Function, **kwargs: Any) -> Docstring
244244 if attr_or_func .is_attribute :
245245 annotation = attr_or_func .annotation
246246 elif attr_or_func .is_function :
247- annotation = attr_or_func .returns # type: ignore[union-attr ]
247+ annotation = attr_or_func .returns # ty: ignore[unresolved-attribute ]
248248 else :
249249 return None
250250 metadata = _metadata (annotation )
@@ -260,7 +260,7 @@ def _deprecated_docs(
260260 if attr_or_func .is_attribute :
261261 annotation = attr_or_func .annotation
262262 elif attr_or_func .is_function :
263- annotation = attr_or_func .returns # type: ignore[union-attr ]
263+ annotation = attr_or_func .returns # ty: ignore[unresolved-attribute ]
264264 else :
265265 return None
266266 metadata = _metadata (annotation )
0 commit comments