def submapping(self, start, stop):
bounds, values, nothing = self._bounds, self._values, self.nothing
lindex = bisect_right(bounds, start) if start is not None else 0
rindex = (bisect_left(bounds, stop)
if stop is not None else len(bounds))
res = type(self)()
res._bounds = blist(bounds[lindex:rindex])
res._values = blist(values[lindex:rindex + 1])
if start is not None:
res[:start] = nothing
if stop is not None:
res[stop:] = nothing
return res
评论列表
文章目录