Skip to main content

Efficient storage for sets of mostly-consecutive integers

Project description

RangeSet
======

License: Your choice of MIT or Apache License 2.0

---------

Python Sets are nice to work with, but very inefficient if you need a large
set with mostly-consecutive integers. The RangeSet class provides efficient
handling and storage for these sets.

Non-integers?
=============

RangeSet works with any class whose instances are

* comparable

* step-able, i.e. you can add 1 to them / subtract 1 from them.

* discrete, i.e. there is no value between ``n`` and ``n+1``.

RangeSet doesn't add or subtract any other values, nor does it try to
subtract two instances from each other.

The requirement to subtract 1 is an optimization that could be removed if
necessary.

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

range_set-0.1.0.tar.gz (20.9 kB view details)

Uploaded Source

File details

Details for the file range_set-0.1.0.tar.gz.

File metadata

  • Download URL: range_set-0.1.0.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.6

File hashes

Hashes for range_set-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0500ec07b6015f7c7d644c6f5d00adc85a042756b94308cedefefed9111930b2
MD5 097eb4411b927baece428f894e8c85ea
BLAKE2b-256 85e4eee8544f7dc2e713f7262988ecdbde272071c00d9f3d8ce2d14afe8e2c0a

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