util.py 文件源码

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

项目:deb-python-cassandra-driver 作者: openstack 项目源码 文件源码
def union(self, *others):
        union = sortedset()
        union._items = list(self._items)
        for other in others:
            if isinstance(other, self.__class__):
                i = 0
                for item in other._items:
                    i = bisect_left(union._items, item, i)
                    if i < len(union._items):
                        if item != union._items[i]:
                            union._items.insert(i, item)
                    else:
                        union._items.append(item)
            else:
                for item in other:
                    union.add(item)
        return union
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号