Skip to content

contains() not working for components? #19

Description

@nzqo

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions