Package SCons :: Package compat :: Module _scons_sets15 :: Class Set
[hide private]
[frames] | no frames]

Class Set

source code

The set class. It can contain mutable objects.
Instance Methods [hide private]
 
__init__(self, seq=None)
The constructor.
source code
 
__str__(self) source code
 
copy(self)
Shallow copy of a set object.
source code
 
__contains__(self, elem) source code
 
__len__(self) source code
 
__getitem__(self, index) source code
 
items(self)
Returns a list of the elements in the set.
source code
 
add(self, elem)
Add one element to the set.
source code
 
remove(self, elem)
Remove an element from the set.
source code
 
discard(self, elem)
Remove an element from the set.
source code
 
sort(self, func=<built-in function cmp>) source code
 
__iter__(self) source code
 
__or__(self, other)
Union of two sets.
source code
 
__sub__(self, other)
Difference of two sets.
source code
 
__and__(self, other)
Intersection of two sets.
source code
 
__add__(self, other)
Symmetric difference of two sets.
source code
 
__mul__(self, other)
Cartesian product of two sets.
source code
 
__lt__(self, other)
Returns 1 if the lhs set is contained but not equal to the rhs set.
source code
 
__le__(self, other)
Returns 1 if the lhs set is contained in the rhs set.
source code
 
__eq__(self, other)
Returns 1 if the sets are equal.
source code
 
__cmp__(self, other)
Returns 1 if the sets are equal.
source code
Method Details [hide private]

__init__(self, seq=None)
(Constructor)

source code 
The constructor. It can take any object giving an iterator as an optional argument to populate the new set.

remove(self, elem)

source code 
Remove an element from the set. Return an error if elem is not in the set.

discard(self, elem)

source code 
Remove an element from the set. Do nothing if elem is not in the set.