def __init__(self,
                 intervals: List[Interval] = None,
                 no_overlap: bool = True,
                 no_contiguous: bool = True) -> None:
        """
        Creates the :class:`IntervalList`.

        Args:
            intervals: optional list of :class:`Interval` objects to
                incorporate into the :class:`IntervalList`
            no_overlap: merge intervals that overlap (now and on subsequent
                addition)?
            no_contiguous: if ``no_overlap`` is set, merge intervals that are
                contiguous too?
        """
        # DO NOT USE intervals=[] in the function signature; that's the route
        # to a mutable default and a huge amount of confusion as separate
        # objects appear non-independent.
        self.intervals = [] if intervals is None else list(intervals)
        self.no_overlap = no_overlap
        self.no_contiguous = no_contiguous
        for i in self.intervals:
            if not isinstance(i, Interval):
                raise TypeError(
                    "IntervalList creation failed: contents are not all "
                    "Interval: {}".format(repr(self.intervals)))
        self._tidy()
def __init__ ( self , intervals : List [ Interval ] = None , no_overlap : bool = True , no_contiguous : bool = True ) -> None : self . intervals = [ ] if intervals is None else list ( intervals ) self . no_overlap = no_overlap self . no_contiguous = no_contiguous for i in self . intervals : if not isinstance ( i , Interval ) : raise TypeError ( "IntervalList creation failed: contents are not all " "Interval: {}" . format ( repr ( self . intervals ) ) ) self . _tidy ( )
Creates the :class:`IntervalList`.

        Args:
            intervals: optional list of :class:`Interval` objects to
                incorporate into the :class:`IntervalList`
            no_overlap: merge intervals that overlap (now and on subsequent
                addition)?
            no_contiguous: if ``no_overlap`` is set, merge intervals that are
                contiguous too?