Home | Trees | Index | Help |
|
---|
Package dns :: Module set :: Class Set |
|
object
--+
|
Set
Rdataset
A simple set class.
Sets are not in Python until 2.3, and rdata are not immutable so we cannot use sets.Set anyway. This class implements subset of the 2.3 Set interface using a list as the container.Method Summary | |
---|---|
Initialize the set. | |
__add__(self,
other)
| |
__and__(self,
other)
| |
Make a (shallow) copy of the set. | |
__eq__(self,
other)
| |
__iadd__(self,
other)
| |
__iand__(self,
other)
| |
__ior__(self,
other)
| |
__isub__(self,
other)
| |
__iter__(self)
| |
__len__(self)
| |
__ne__(self,
other)
| |
a new object with type S, a subtype of T |
|
__or__(self,
other)
| |
__repr__(self)
| |
__sub__(self,
other)
| |
Add an item to the set. | |
Make the set empty. | |
Make a (shallow) copy of the set. | |
the same type as self |
Return a new set which self - other, i.e. |
Update the set, removing any elements from other which are in the set. | |
Remove an item from the set if present. | |
the same type as self |
Return a new set which is the intersection of self and other. |
Update the set, removing any elements from other which are not in both sets. | |
bool |
Is self a subset of other? |
bool |
Is self a superset of other? |
Remove an item from the set. | |
the same type as self |
Return a new set which is the union of self and other. |
Update the set, adding any elements from other which are not already in the set. | |
Update the set, adding any elements from other which are not already in the set. | |
Make a (shallow) copy of the set. |
Instance Variable Summary | |
---|---|
items
- A list of the items which are in the set |
Class Variable Summary | |
---|---|
list |
__slots__
|
list | items
|
Method Details |
---|
__init__(self,
items=None)
Initialize the set.
|
__copy__(self)Make a (shallow) copy of the set. |
__new__(S, ...)
|
add(self, item)Add an item to the set. |
clear(self)Make the set empty. |
copy(self)Make a (shallow) copy of the set. |
difference(self, other)Return a new set which self - other, i.e. the items in self which are not also in other.
|
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(self, other)Return a new set which is the intersection of self and other.
|
intersection_update(self, other)Update the set, removing any elements from other which are not in both sets.
|
issubset(self, other)Is self a subset of other?
|
issuperset(self, other)Is self a superset of other?
|
remove(self, item)Remove an item from the set. |
union(self, other)Return a new set which is the union of self and other.
|
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.
|
_clone(self)Make a (shallow) copy of the set. There is a 'clone protocol' that subclasses of this class should use. To make a copy, first call your super's _clone() method, and use the object returned as the new instance. Then make shallow copies of the attributes defined in the subclass. This protocol allows us to write the set algorithms that return new instances (e.g. union) once, and keep using them in subclasses. |
Instance Variable Details |
---|
itemsA list of the items which are in the set |
Class Variable Details |
---|
__slots__
|
items
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 1.1 on Sun Jun 6 13:48:49 2004 | http://epydoc.sf.net |