I need to write a method that tells me if a set of intervals is contained in another. When trying on a single interval like such:
import interval as itv
tst = itv.interval([0,1],[-7,-1],[2,3])
def contains(itvset_a, itvset_b):
for x,y in zip(itvset_a,itvset_b):
if not x.__contains__(y):
return False
return True
print(contains(tst,tst))
it returns False. However, it correctly zips up the components of the interval, meaning that for a component a.__contains__(a) is evaluated to False. Why is that?
Note that changing the call to print(contains([tst5],[tst5])) works perfectly fine.
I need to write a method that tells me if a set of intervals is contained in another. When trying on a single interval like such:
it returns False. However, it correctly zips up the components of the interval, meaning that for a component
a.__contains__(a)
is evaluated to False. Why is that? Note that changing the call toprint(contains([tst5],[tst5]))
works perfectly fine.