def can_be_index(obj):
    """Determine if an object can be used as the index of a sequence.

    :param any obj: The object to test
    :returns bool: Whether it can be an index or not

    """
    try:
        [][obj]
    except TypeError:
        return False
    except IndexError:
        return True