@@ -134,7 +134,7 @@ def unwrap_all(obj: Any, *, stop: Callable = None) -> Any:
134134 elif ispartial (obj ):
135135 obj = obj .func
136136 elif inspect .isroutine (obj ) and hasattr (obj , '__wrapped__' ):
137- obj = obj .__wrapped__
137+ obj = obj .__wrapped__ # type: ignore
138138 elif isclassmethod (obj ):
139139 obj = obj .__func__
140140 elif isstaticmethod (obj ):
@@ -692,7 +692,7 @@ def signature(subject: Callable, bound_method: bool = False, follow_wrapped: boo
692692 #
693693 # For example, this helps a function having a default value `inspect._empty`.
694694 # refs: https://github.com/sphinx-doc/sphinx/issues/7935
695- return inspect .Signature (parameters , return_annotation = return_annotation , # type: ignore
695+ return inspect .Signature (parameters , return_annotation = return_annotation ,
696696 __validate_parameters__ = False )
697697
698698
@@ -820,14 +820,14 @@ def signature_from_ast(node: ast.FunctionDef, code: str = '') -> inspect.Signatu
820820 positionals = len (args .args )
821821
822822 for _ in range (len (defaults ), positionals ):
823- defaults .insert (0 , Parameter .empty )
823+ defaults .insert (0 , Parameter .empty ) # type: ignore
824824
825825 if hasattr (args , "posonlyargs" ):
826826 for i , arg in enumerate (args .posonlyargs ): # type: ignore
827827 if defaults [i ] is Parameter .empty :
828828 default = Parameter .empty
829829 else :
830- default = DefaultValue (ast_unparse (defaults [i ], code ))
830+ default = DefaultValue (ast_unparse (defaults [i ], code )) # type: ignore
831831
832832 annotation = ast_unparse (arg .annotation , code ) or Parameter .empty
833833 params .append (Parameter (arg .arg , Parameter .POSITIONAL_ONLY ,
@@ -837,7 +837,7 @@ def signature_from_ast(node: ast.FunctionDef, code: str = '') -> inspect.Signatu
837837 if defaults [i + posonlyargs ] is Parameter .empty :
838838 default = Parameter .empty
839839 else :
840- default = DefaultValue (ast_unparse (defaults [i + posonlyargs ], code ))
840+ default = DefaultValue (ast_unparse (defaults [i + posonlyargs ], code )) # type: ignore # NOQA
841841
842842 annotation = ast_unparse (arg .annotation , code ) or Parameter .empty
843843 params .append (Parameter (arg .arg , Parameter .POSITIONAL_OR_KEYWORD ,
@@ -849,7 +849,7 @@ def signature_from_ast(node: ast.FunctionDef, code: str = '') -> inspect.Signatu
849849 annotation = annotation ))
850850
851851 for i , arg in enumerate (args .kwonlyargs ):
852- default = ast_unparse (args .kw_defaults [i ], code ) or Parameter .empty
852+ default = ast_unparse (args .kw_defaults [i ], code ) or Parameter .empty # type: ignore
853853 annotation = ast_unparse (arg .annotation , code ) or Parameter .empty
854854 params .append (Parameter (arg .arg , Parameter .KEYWORD_ONLY , default = default ,
855855 annotation = annotation ))
0 commit comments