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.

Source Distribution

ringbuffer-0.0.2.tar.gz (1.9 kB view details)

Uploaded Source

File details

Details for the file ringbuffer-0.0.2.tar.gz.

File metadata

  • Download URL: ringbuffer-0.0.2.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ringbuffer-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c089a98e66e737a9154c1462e3e4e12c8b7b8a6236c0a65603dd937e24e7f12d
MD5 02d4a539ca4cc270d29c5cb322fdc5c4
BLAKE2b-256 c15e1f2081d73a95ea0415496075446237068f36e01839d7390e45431d3c98d3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page