original_docstring: Update annotations info of *obj* using type_comments.
docstring: Update annotations info of *obj* using type_comments.
docstring_tokens: Update annotations info of * obj * using type_comments .
code: def update_annotations_using_type_comments(app: Sphinx, obj: Any, bound_method: bool) -> None:
      """Update annotations info of *obj* using type_comments."""
      try:
          function = get_type_comment(obj)
          if function and hasattr(function, 'argtypes'):
              if function.argtypes != [ast.Ellipsis]:  # type: ignore
                  sig = inspect.signature(obj, bound_method)
                  for i, param in enumerate(sig.parameters.values()):
                      if param.name not in obj.__annotations__:
                          annotation = ast_unparse(function.argtypes[i])  # type: ignore
                          obj.__annotations__[param.name] = annotation
  
              if 'return' not in obj.__annotations__:
                  obj.__annotations__['return'] = ast_unparse(function.returns)  # type: ignore
      except NotImplementedError as exc:  # failed to ast.unparse()
          logger.warning("Failed to parse type_comment for %r: %s", obj, exc)
code_tokens: def update_annotations_using_type_comments ( app : Sphinx , obj : Any , bound_method : bool ) -> None : try : function = get_type_comment ( obj ) if function and hasattr ( function , 'argtypes' ) : if function . argtypes != [ ast . Ellipsis ] : sig = inspect . signature ( obj , bound_method ) for i , param in enumerate ( sig . parameters . values ( ) ) : if param . name not in obj . __annotations__ : annotation = ast_unparse ( function . argtypes [ i ] ) obj . __annotations__ [ param . name ] = annotation if 'return' not in obj . __annotations__ : obj . __annotations__ [ 'return' ] = ast_unparse ( function . returns ) except NotImplementedError as exc : logger . warning ( "Failed to parse type_comment for %r: %s" , obj , exc )
short_docstring: Update annotations info of *obj* using type_comments.
short_docstring_tokens: Update annotations info of * obj * using type_comments .
comment: """Update annotations info of *obj* using type_comments."""$SEP$# type: ignore$SEP$# type: ignore$SEP$# type: ignore$SEP$# failed to ast.unparse()