Is there a discontinuous range class for Python?
<p>I'd like to represent an arbitrarily complex range of real values, which can be discontinuous, i.e.:</p>

<pre><code>0--4 and 5--6 and 7.12423--8
</code></pre>

<p>Where I'll be adding new ranges incrementally:</p>

<pre><code>(0--4 and 5--6 and 7.12423--8) | ( 2--7) = (0--7 and 7.12423--8)
</code></pre>

<p>I don't really know the right language to describe this, so I'm struggling to search, but it seems like a class probably already exists to do what I want to do. Does it?</p>
