def indexget(obj, i, default=None):
  """
  Return obj[i] if possible, else default.

  Similar to dict.get() but for integer indexed objects.
  """
  try:
    return obj[i]
  except (IndexError, TypeError, KeyError):
    return default