Skip to main content

Random access associative ring buffer

Project description

Summary

General implementation of an associative ring buffer. Random access time is like with any other dictionary - O(1), memory consumption is also similar.

Usage

>>> r = Ring({}, 5)
>>> r[0] = "A"
>>> r[1] = "B"
>>> r[2] = "C"
>>> r[3] = "D"
>>> r[4] = "E"
>>> r
Ring([(0, 'A'), (1, 'B'), (2, 'C'), (3, 'D'), (4, 'E')])
>>> r[5] = "F"
>>> r
Ring([(1, 'B'), (2, 'C'), (3, 'D'), (4, 'E'), (5, 'F')])
>>>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
ringbuffer-0.0.1.tar.gz (1.8 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page