parameters: (sig)
return_statement: return sig.replace(parameters=params)
docstring: Private helper to transform signatures for unbound
      functions to bound methods.
docstring_summary: Private helper to transform signatures for unbound
      functions to bound methods.
docstring_tokens: Private helper to transform signatures for unbound functions to bound methods .
function: def _signature_bound_method(sig):
      """Private helper to transform signatures for unbound
      functions to bound methods.
      """
  
      params = tuple(sig.parameters.values())
  
      if not params or params[0].kind in (_VAR_KEYWORD, _KEYWORD_ONLY):
          raise ValueError('invalid method signature')
  
      kind = params[0].kind
      if kind in (_POSITIONAL_OR_KEYWORD, _POSITIONAL_ONLY):
          # Drop first parameter:
          # '(p1, p2[, ...])' -> '(p2[, ...])'
          params = params[1:]
      else:
          if kind is not _VAR_POSITIONAL:
              # Unless we add a new parameter type we never
              # get here
              raise ValueError('invalid argument type')
          # It's a var-positional parameter.
          # Do nothing. '(*args[, ...])' -> '(*args[, ...])'
  
      return sig.replace(parameters=params)
function_tokens: def _signature_bound_method ( sig ) : params = tuple ( sig . parameters . values ( ) ) if not params or params [ 0 ] . kind in ( _VAR_KEYWORD , _KEYWORD_ONLY ) : raise ValueError ( 'invalid method signature' ) kind = params [ 0 ] . kind if kind in ( _POSITIONAL_OR_KEYWORD , _POSITIONAL_ONLY ) : # Drop first parameter: # '(p1, p2[, ...])' -> '(p2[, ...])' params = params [ 1 : ] else : if kind is not _VAR_POSITIONAL : # Unless we add a new parameter type we never # get here raise ValueError ( 'invalid argument type' ) # It's a var-positional parameter. # Do nothing. '(*args[, ...])' -> '(*args[, ...])' return sig . replace ( parameters = params )