recipe-577515.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:code 作者: ActiveState 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号