Skip to main content

Efficient storage for sets of mostly-consecutive integers

Project description

License: Your choice of MIT or Apache License 2.0

Rationale

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.3.2.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

range_set-0.3.2-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: range_set-0.3.2.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for range_set-0.3.2.tar.gz
Algorithm Hash digest
SHA256 a233bff13ee3304d3d078fce1ca941baf51e237da55838e61dedf48e93b0b0bc
MD5 0bce11723a0b911e28b8e25256dc8c46
BLAKE2b-256 34d173c6b547efedf080efbc46139b222ec487b23f7eee86c94c9a457a2a6d16

See more details on using hashes here.

File details

Details for the file range_set-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: range_set-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for range_set-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 07380f2635f0cbabaf825109130a59bba342ef747e4d54486ab725dac0e03217
MD5 d3f34f19b498fc97ff2e502ec38eefdd
BLAKE2b-256 258312bd72b9630dc0e7e1fcb2d521244772050da8bfefcf192dcee8ef82d1fb

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