def sorted_chain ( * ranges : Iterable [ Tuple [ int , int ] ] ) -> List [ Tuple [ int , int ] ] : return sorted ( itertools . chain ( * ranges ) )
can you set a range on the sort function in python
Chain & sort ranges .
def sorted_chain(*ranges: Iterable[Tuple[int, int]]) -> List[Tuple[int, int]]:
    """Chain & sort ranges."""
    return sorted(itertools.chain(*ranges))