How to join integers intervals in python?
<p>I have used the module intervals (<a href="http://pyinterval.readthedocs.io/en/latest/index.html" rel="nofollow">http://pyinterval.readthedocs.io/en/latest/index.html</a>)</p>

<p>And created an interval from a set or start, end tuples:</p>

<pre><code>intervals = interval.interval([1,8], [7,10], [15,20])
</code></pre>

<p>Which result in interval([1.0, 10.0], [15.0, 20.0]) as the [1,8] and [7,10] overlaps.</p>

<p>But this module interprets the values of the pairs as real numbers, so two continuous intervals in integers will not be joined together. </p>

<p>Example:</p>

<pre><code>intervals = interval.interval([1,8], [9,10], [11,20]) 
</code></pre>

<p>results in: interval([1.0, 8.0], [9.0, 10.0], [11.0, 20.0])</p>

<p>My question is how can I join this intervals as integers and not as real numbers? And in the last example the result would be interval([1.0, 20.0])</p>