def result_set_len(result_set):
    """
    Calculate the length of a result set.
    :param result_set: the result set we want to know the length.
    :return: the length of the result set.
    """
    try:
        return len(result_set)
    except TypeError:
        return 0