clothesline

A library to handle sets, made of intervals over a continuous infinite axis (a “domain”) such as the real numbers or date/times.

import clothesline
bld = clothesline.RealIntervalSet.builder()
set1 = bld[-10](10) - bld(0)[1]
set1                       # [-10, 0] U (1, 10)
set1.extension()           # 19
set2 = set1 + bld[100](...)
set2.complement()          # (-inf, -10) U (0, 1] U [10, 100)
set2 + set2.complement()   # (-inf, +inf)

For a primer, jump to Quickstart. Then you may be interested in the User guide. To build your own extension (covering a custom domain), see Customize (which does not require knowledge of the Structure).

Alternative text