Skip to main content

a Range class implementing compact integer ranges with a set-like API, and associated functions

Project description

A Range is used to represent integer ranges, such a file offset spans.

Much of the set API is presented to modify and test Ranges, looking somewhat like sets of intergers but extended slightly to accept ranges as well as individual integers so that one may say “R.add(start, end)” and so forth.

Also provided:

  • Span, a simple start:end range.
  • overlap: return the overlap of two Spans
  • spans: return an iterable of Spans for all contiguous sequences in the ordered integers supplied

Project details

Download files

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

Files for cs.range, version 20160828
Filename, size File type Python version Upload date Hashes
Filename, size cs.range-20160828.tar.gz (5.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page