def IsStrCanonicalInt(string):
 if (type(string) is str):
  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 ) : 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
returns true if |string| is in its canonical integer form .