def iteritems(self, yield_nothing=False):
        """Iterate in order over the (interval, value) pairs of the mapping.

        If yield_nothing is true, the self.nothing marker is returned for
        unset intervals.
        """
        
        bounds, values, nothing = self._bounds, self._values, self.nothing

        keys = (Interval(a, b)
                for a, b in pairwise(chain([None], bounds, [None])))
        if yield_nothing:
            return izip(keys, values)
        else:
            return ((k, v) for k, v in izip(keys, values) if v is not nothing)
Iterate in order over the (interval, value) pairs of the mapping.

        If yield_nothing is true, the self.nothing marker is returned for
        unset intervals.
        
recipes/Python/577515_interval_mapping/recipe-577515.py