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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cs.range-20150116.tar.gz
(5.2 kB
view hashes)