I'm using the pyinterval package to represent unions of open intervals. Thus I would like to have an easy way to get rid of components whose inf and sup are identical. Is there a more elegant way to do it than the following?
b = interval()
for i in a:
if i.sup > i.inf:
b |= i
a = b
I'm using the
pyinterval
package to represent unions of open intervals. Thus I would like to have an easy way to get rid of components whoseinf
andsup
are identical. Is there a more elegant way to do it than the following?