diff options
| author | Bob Halley <halley@dnspython.org> | 2005-09-02 05:32:59 +0000 |
|---|---|---|
| committer | Bob Halley <halley@dnspython.org> | 2005-09-02 05:32:59 +0000 |
| commit | cc161b2ddc100a00e920b37469ae6d03213f4aa1 (patch) | |
| tree | 11532ae1460a32fade18535cabd7288a73bf4914 /dns/set.py | |
| parent | 1c459a1d39328893a5f5308a1931efbb0d381c7d (diff) | |
| download | dnspython-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.py | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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}? |
