diff options
author | Rob Austein <sra@hactrn.net> | 2007-10-06 05:46:28 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2007-10-06 05:46:28 +0000 |
commit | e364ef51ed453b0d438ed5a5453179d552c298a1 (patch) | |
tree | ca69edc11d6845283310e9e1b3492e1323d22a03 /scripts/rpki/resource_set.py | |
parent | df13a05b469e4362d77d417d6543f03f0b7a160e (diff) |
Checkpoint
svn path=/scripts/rpki/left_right.py; revision=1103
Diffstat (limited to 'scripts/rpki/resource_set.py')
-rw-r--r-- | scripts/rpki/resource_set.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/rpki/resource_set.py b/scripts/rpki/resource_set.py index b0de948b..705b0ac7 100644 --- a/scripts/rpki/resource_set.py +++ b/scripts/rpki/resource_set.py @@ -208,6 +208,17 @@ class resource_set(list): assert isinstance(item, (type(i), type(i.min))) return False + def issubset(self, other): + """Test whether self is a subset of other.""" + for i in self: + if not other.contains(i): + return False + return True + + def issuperset(self, other): + """Test whether self is a superset of other.""" + return other.issubset(self) + @classmethod def from_sql(cls, cursor, query): """Create resource set from an SQL query. |