def _convert_if_int(value):
 try:
  value = int(str(value))
 except ValueError:
  pass
 return value

def _convert_if_int ( value ) : try : value = int ( str ( value ) ) except ValueError : pass return value
convert to an int if necessary .