(string)
return False
Returns True if |string| is in its canonical integer form.

  The canonical form is such that str(int(string)) == string.
Returns True if |string| is in its canonical integer form.
Returns True if |string| is in its canonical integer form .
def IsStrCanonicalInt(string):
  """Returns True if |string| is in its canonical integer form.

  The canonical form is such that str(int(string)) == string.
  """
  if type(string) is str:
    # This function is called a lot so for maximum performance, avoid
    # involving regexps which would otherwise make the code much
    # shorter. Regexps would need twice the time of this function.
    if string:
      if string == "0":
        return True
      if string[0] == "-":
        string = string[1:]
        if not string:
          return False
      if '1' <= string[0] <= '9':
        return string.isdigit()

  return False
def IsStrCanonicalInt ( string ) : if type ( string ) is str : # This function is called a lot so for maximum performance, avoid # involving regexps which would otherwise make the code much # shorter. Regexps would need twice the time of this function. if string : if string == "0" : return True if string [ 0 ] == "-" : string = string [ 1 : ] if not string : return False if '1' <= string [ 0 ] <= '9' : return string . isdigit ( ) return False