1 Star 0 Fork 0

微距离/pythonnet

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
test_collection_mixins.py 521 Bytes
一键复制 编辑 原始数据 按行查看 历史
import System.Collections.Generic as C
def test_contains():
l = C.List[int]()
l.Add(42)
assert 42 in l
assert 43 not in l
def test_dict_items():
d = C.Dictionary[int, str]()
d[42] = "a"
items = d.items()
assert len(items) == 1
k,v = items[0]
assert k == 42
assert v == "a"
# regression test for https://github.com/pythonnet/pythonnet/issues/1785
def test_dict_in_keys():
d = C.Dictionary[str, int]()
d["a"] = 42
assert "a" in d.Keys
assert "b" not in d.Keys
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/MicroDistanceStudio/pythonnet.git
git@gitee.com:MicroDistanceStudio/pythonnet.git
MicroDistanceStudio
pythonnet
pythonnet
master

搜索帮助