sets :: Set :: Class Set
[hide private]
[frames] | no frames]

Class Set



object --+    
         |    
   BaseSet --+
             |
            Set

Mutable set class.

Instance Methods [hide private]
 
__as_immutable__(self)
 
__as_temporarily_immutable__(self)
 
__getstate__(self)
 
__hash__(self)
A Set cannot be hashed.
 
__iand__(self, other)
Update a set with the intersection of itself and another.
 
__init__(self, iterable=None)
Construct a set from an optional iterable.
 
__ior__(self, other)
Update a set with the union of itself and another.
 
__isub__(self, other)
Remove all elements of another set from this set.
 
__ixor__(self, other)
Update a set with the symmetric difference of itself and another.
 
__setstate__(self, data)
 
add(self, element)
Add an element to a set.
 
clear(self)
Remove all elements from this set.
 
difference_update(self, other)
Remove all elements of another set from this set.
 
discard(self, element)
Remove an element from a set if it is a member.
 
intersection_update(self, other)
Update a set with the intersection of itself and another.
 
pop(self)
Remove and return an arbitrary set element.
 
remove(self, element)
Remove an element from a set; it must be a member.
 
symmetric_difference_update(self, other)
Update a set with the symmetric difference of itself and another.
 
union_update(self, other)
Update a set with the union of itself and another.
 
update(self, iterable)
Add all values from an iterable (such as a list or file).

Inherited from BaseSet: __and__, __cmp__, __contains__, __copy__, __deepcopy__, __eq__, __ge__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __or__, __repr__, __str__, __sub__, __xor__, copy, difference, intersection, issubset, issuperset, symmetric_difference, union

Inherited from BaseSet (private): _binary_sanity_check, _compute_hash, _repr, _update

Inherited from object: __delattr__, __getattribute__, __new__, __reduce__, __reduce_ex__, __setattr__

Properties [hide private]

Inherited from BaseSet (private): _data

Inherited from object: __class__

Method Details [hide private]

__hash__(self)
(Hashing function)

 
A Set cannot be hashed.
Overrides: object.__hash__

__init__(self, iterable=None)
(Constructor)

 
Construct a set from an optional iterable.
Overrides: BaseSet.__init__

add(self, element)

 

Add an element to a set.

This has no effect if the element is already present.

discard(self, element)

 

Remove an element from a set if it is a member.

If the element is not a member, do nothing.

remove(self, element)

 

Remove an element from a set; it must be a member.

If the element is not a member, raise a KeyError.