A very simple set class.
Sets are not in Python until 2.3, and we also don't have a hash
function for rdata which deals with name equivalence, so if we use a set
based on dictionaries we could end up with a set which contained objects
that were equal. To avoid all of this trouble, we have our own simple set
class. It implements a subset of the 2.3 Set interface using a list.
Method Summary |
|
__init__ (self)
Initialize the set, making it empty. |
|
__eq__(self,
other)
|
|
__getstate__(...)
|
|
__iter__(self)
|
|
__len__(self)
|
|
__ne__(self,
other)
|
a new object with type S, a subtype of T
|
__new__ (S,
...)
|
|
add (self,
item)
Add an item to the set. |
|
clear (self)
Make the set empty. |
|
difference_update (self,
other)
Update the set, removing any elements from other which are in the
set. |
|
discard (self,
item)
Remove an item from the set if present. |
|
intersection_update (self,
other)
Update the set, removing any elements from other which are not in both
sets. |
|
remove (self,
item)
Remove an item from the set. |
|
union_update (self,
other)
Update the set, adding any elements from other which are not already
in the set. |
|
update (self,
other)
Update the set, adding any elements from other which are not already
in the set. |