summaryrefslogtreecommitdiff
path: root/dns/set.py
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2005-09-02 05:32:59 +0000
committerBob Halley <halley@dnspython.org>2005-09-02 05:32:59 +0000
commitcc161b2ddc100a00e920b37469ae6d03213f4aa1 (patch)
tree11532ae1460a32fade18535cabd7288a73bf4914 /dns/set.py
parent1c459a1d39328893a5f5308a1931efbb0d381c7d (diff)
downloaddnspython-cc161b2ddc100a00e920b37469ae6d03213f4aa1.tar.gz
add get/del item/slice
Original author: Bob Halley <halley@dnspython.org> Date: 2005-05-06 23:39:25
Diffstat (limited to 'dns/set.py')
-rw-r--r--dns/set.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/dns/set.py b/dns/set.py
index a5dd966..6a2363c 100644
--- a/dns/set.py
+++ b/dns/set.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2003-2005 Nominum, Inc.
+# Copyright (C) 2003, 2004 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
@@ -224,6 +224,18 @@ class Set(object):
def __iter__(self):
return iter(self.items)
+ def __getitem__(self, i):
+ return self.items[i]
+
+ def __delitem__(self, i):
+ del self.items[i]
+
+ def __getslice__(self, i, j):
+ return self.items[i:j]
+
+ def __delslice__(self, i, j):
+ del self.items[i:j]
+
def issubset(self, other):
"""Is I{self} a subset of I{other}?