def ranges_overlap(range1, range2):
    """Whether two 2-element lists have an overlap.

    Args:
        range1, range2: Each a 2-element list with numbers.

    Returns:
        True if there is overlap, False otherwise.

    Raises:
        TypeError: An argument is not a list.
        ValueError: One of the list doesn’t have exactly 2 elements.
    """
    if not isinstance(range1, list) or not isinstance(range2, list):
        raise TypeError('Both arguments must be a list.')
    if len(range1) != 2 or len(range2) != 2:
        raise ValueError('Both lists must have two elements each.')
    if max(range1) < min(range2):
        return False
    if max(range2) < min(range1):
        return False
    return True