a Container datatype wrapper for the Python standard library heapq module
Project description
heapq-container
a Container datatype wrapper for the Python standard library heapq module.
Installation
Install this library using pip
:
pip install heapq-container
Usage
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]
Development
To contribute to this library, first checkout the code. Then create a new virtual environment:
cd heapq-container
python -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
heapq_container-0.1.tar.gz
(7.5 kB
view hashes)
Built Distribution
Close
Hashes for heapq_container-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f4b07fa28f55c8f0e946e57027004d52f8b9b151b28488d187d005d8dd0047c |
|
MD5 | 57332247b515938627759aeb7fac5eae |
|
BLAKE2b-256 | 2a7bfb0256f4f819310fb175e83411b0ff73ab8938bfc4b8da692f27b4d2b62f |