Efficient circular buffer implementation in Python with optional Numba JIT compilation
Project description
Efficient circular buffer implementation in Python with optional Numba JIT compilation
Usage
import circular_buffer
buffer_of_int_type = circular_buffer.for_instances_like(123)
buf = buffer_of_int_type(size = 10, autoexpand = True)
for i in range(12):
buf.push_back(i)
assert buf.pop_front() == 0
assert buf.front() == 1
assert buf.back() == 11
Remember to install numba JIT compiler package to get a small extra speedup. numba can be
automatically installed if you install this package via pip install circular-buffer[numba]
.
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
circular-buffer-0.2.0.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for circular_buffer-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26678b4f49a335595487f6610a5f936aa61928538e73ef3d05aebc3f1f0227d1 |
|
MD5 | 451dfc2906459f414e59d744e3a68d10 |
|
BLAKE2b-256 | bebfdd3b80371c40eb251b8cef251c52e8ab8528b38b98a9c7fb0ab6e1ff1182 |