跳转到主要内容

使用给定键比较两个Python列表

项目描述

概述

使用给定键比较两个Python列表

image

用法

listA = [3, 2, 1]
listB = [5, 4, 3]
inA, inBoth, inB = DiffUnsortedLists(listA=listA, listB=listB, keyA=lambda x: x, keyB=lambda x: x)
assert inA == [1, 2]
assert inBoth == [(3, 3)]
assert inB == [4, 5]

listA = [1, 2, 3]
listB = [3, 4, 5]
resultB = DiffListsByKey(iterA=iter(listA), iterB=iter(listB), keyA=lambda x: x, keyB=lambda x: x)
assert inA == [1, 2]
assert inBoth == [(3, 3)]
assert inB == [4, 5]

项目详情


下载文件

为您的平台下载文件。如果您不确定选择哪个,请了解更多关于 安装软件包 的信息。

源代码分布

listdiff-1.0.2.tar.gz (3.0 kB 查看哈希值)

上传时间: 源代码

构建分布

listdiff-1.0.2-py3-none-any.whl (3.3 kB 查看哈希值)

上传时间: Python 3

支持者