a Range class implementing compact integer ranges with a set-like API, and associated functions
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.
- 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
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|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|