def _number(text):
 if text.isdigit():
  return int(text)
 try:
  return float(text)
 except ValueError:
  return text

def _number ( text ) : if text . isdigit ( ) : return int ( text ) try : return float ( text ) except ValueError : return text
convert a string to a number .