docs: def get_int(prompt=None):
      """
      Read a line of text from standard input and return the equivalent int;
      if text does not represent an int, user is prompted to retry. If line
      can't be read, return None.
      """
      while True:
          s = get_string(prompt)
          if s is None:
              return None
          if re.search(r"^[+-]?\d+$", s):
              try:
                  i = int(s, 10)
                  if type(i) is int:  # Could become long in Python 2
                      return i
              except ValueError:
                  pass
  
          # Temporarily here for backwards compatibility
          if prompt is None:
              print("Retry: ", end="")