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

Type Set

object --+    
         |    
   BaseSet --+
             |
            Set


Mutable set class.
Method Summary
  __init__(self, iterable)
Construct a set from an optional iterable.
  __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.
  __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__(self, other)
Return the intersection of two sets as a new set.
  __cmp__(self, other)
  __contains__(self, element)
Report whether an element is a member of a set.
  __copy__(self)
Return a shallow copy of a set.
  __deepcopy__(self, memo)
Return a deep copy of a set; used by copy module.
  __eq__(self, other)
  __ge__(self, other)
Report whether this set contains another set.
  __gt__(self, other)
  __iter__(self)
Return an iterator over the elements or a set.
  __le__(self, other)
Report whether another set contains this set.
  __len__(self)
Return the number of elements of a set.
  __lt__(self, other)
  __ne__(self, other)
  __or__(self, other)
Return the union of two sets as a new set.
  __repr__(self)
Return string representation of a set.
  __str__(self)
Return string representation of a set.
  __sub__(self, other)
Return the difference of two sets as a new Set.
  __xor__(self, other)
Return the symmetric difference of two sets as a new set.
  copy(self)
Return a shallow copy of a set.
  difference(self, other)
Return the difference of two sets as a new Set.
  intersection(self, other)
Return the intersection of two sets as a new set.
  issubset(self, other)
Report whether another set contains this set.
  issuperset(self, other)
Report whether this set contains another set.
  symmetric_difference(self, other)
Return the symmetric difference of two sets as a new set.
  union(self, other)
Return the union of two sets as a new set.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value

Class Variable Summary
list __slots__ = []

Method Details

__init__(self, iterable=None)
(Constructor)

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

__hash__(self)
(Hashing function)

A Set cannot be hashed.
Overrides:
__builtin__.object.__hash__

__iand__(self, other)

Update a set with the intersection of itself and another.

__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.

add(self, element)

Add an element to a set.

This has no effect if the element is already present.

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.

If the element is not a member, do nothing.

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.

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

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).

Class Variable Details

__slots__

Type:
list
Value:
[]                                                                     

Generated by Epydoc 2.1 on Fri Jun 24 12:01:23 2005 http://epydoc.sf.net