Note that these endpoints represent
closed intervals,
rather than the half-open intervals commonly used with Python’s range().
If you combine intspan ranges with Python generators, you’ll
have to increment the stop value by one yourself to create the suitable
“half-open interval.”

There is a corresponding range-oriented constructor:

>>> intspan.from_ranges([(4,6),(10,12)])intspan('4-6,10-12')

A convenience from_range method creates a contiguous
intspan from a given low to a high value.:

>>> intspan.from_range(8,12)intspan('8-12')

The universe method returns the covering set or “implied universe” of
an intspan:

The “missing” elements are computed as any integers between the
intspan‘s minimum and maximum values that aren’t included. If you’d like
to customize the intended low and high bounds, you can give those
explicitly.:

>>> items.complement(high=30)intspan('4,6,11-20,25-30')

You can use the difference method or - operator
to find the complement with respect to an arbitrary set, rather than just
an expected contiguous range.