Skip to main content

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.

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.3.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.3-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for range_set-0.3.3.tar.gz
Algorithm Hash digest
SHA256 4d8cb72c2abfd7aab6ac00730020a204d633d29f1ed7ea32d52531108e52bcfd
MD5 1acb660fe62692d32dcdfa3bb112649f
BLAKE2b-256 640a73670a9e60946a5295ea3137eb09f745d1bdfb9f3683b64968e6251563bf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: range_set-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for range_set-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7eebfd08740dc6c2ff5d88a68d10ef130a809054f4d3cc10a0d696d63e03c755
MD5 0e03a78ca1e3d2eb8268cad4f2324945
BLAKE2b-256 a4bf43e2860057d58a7de94fd6e161cde2f627edb4cfc126a5d4500c6a62bfdb

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.3 This release

2 files

0.3.2

2 files

0.3.1

1 file

0.3.0

1 file

0.2.0

1 file

0.1.0

1 file

Supported by

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