def _parse_path(path):
    """
    This function is used to parse a path string into a sequence.  Any empty strings
    are discarded.

    :param path: the string to parse.
    :return: the resulting sequence
    """
    result = []
    if path.startswith('#/'):
        path = path[2:]
    for item in path.split('/'):
        if len(item) > 0:
            if item[:1] == '[' and item[-1:] == ']':
                result.append(int(item[1:-1]))
            else:
                result.append(item)
    return result
