跳转到主要内容

Python标准库heapq模块的容器数据类型包装器

项目描述

heapq-container

PyPI Tests Changelog License

Python标准库heapq模块的容器数据类型包装器。

安装

使用pip安装此库

pip install heapq-container

使用方法

from heapqueue import HeapQueue

 def heapsort(iterable):
    h = HeapQueue(iterable)
    return [h.pop() for _ in range(len(h))]

heapsort([1, 3, 5, 7, 9, 2, 4, 6, 8, 0])
# -> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

开发

要为此库做贡献,首先检出代码。然后创建一个新的虚拟环境

cd heapq-container
python -m venv venv
source venv/bin/activate

现在安装依赖项和测试依赖项

pip install -e '.[test]'

要运行测试

pytest

项目详情


下载文件

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

源代码分发

heapq_container-0.1.tar.gz (7.5 kB 查看哈希值)

上传时间: 源代码

构建分发

heapq_container-0.1-py3-none-any.whl (6.9 kB 查看哈希值)

上传时间: Python 3

由以下提供支持