set :: Class set
[hide private]
[frames] | no frames]

type set

object --+
         |
        set

set(iterable) --> set object

Build an unordered collection of unique elements.

Instance Methods [hide private]
 
__and__(x, y)
x&y
 
__cmp__(x, y)
cmp(x,y)
 
__contains__(x, y)
y in x.
 
__eq__(x, y)
x==y
 
__ge__(x, y)
x>=y
 
__getattribute__(...)
x.__getattribute__('name') <==> x.name
 
__gt__(x, y)
x>y
 
__hash__(x)
hash(x)
 
__iand__(x, y)
x&y
 
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
__ior__(x, y)
x|y
 
__isub__(x, y)
x-y
 
__iter__(x)
iter(x)
 
__ixor__(x, y)
x^y
 
__le__(x, y)
x<=y
 
__len__(x)
len(x)
 
__lt__(x, y)
x<y
 
__ne__(x, y)
x!=y
a new object with type S, a subtype of T
__new__(T, S, ...)
 
__or__(x, y)
x|y
 
__rand__(x, y)
y&x
 
__reduce__(...)
Return state information for pickling.
 
__repr__(x)
repr(x)
 
__ror__(x, y)
y|x
 
__rsub__(x, y)
y-x
 
__rxor__(x, y)
y^x
 
__sub__(x, y)
x-y
 
__xor__(x, y)
x^y
 
add(...)
Add an element to a set.
 
clear(...)
Remove all elements from this set.
 
copy(...)
Return a shallow copy of a set.
 
difference(...)
Return the difference of two sets as a new set.
 
difference_update(...)
Remove all elements of another set from this set.
 
discard(...)
Remove an element from a set if it is a member.
 
intersection(...)
Return the intersection of two sets as a new set.
 
intersection_update(...)
Update a set with the intersection of itself and another.
 
issubset(...)
Report whether another set contains this set.
 
issuperset(...)
Report whether this set contains another set.
 
pop(...)
Remove and return an arbitrary set element.
 
remove(...)
Remove an element from a set; it must be a member.
 
symmetric_difference(...)
Return the symmetric difference of two sets as a new set.
 
symmetric_difference_update(...)
Update a set with the symmetric difference of itself and another.
 
union(...)
Return the union of two sets as a new set.
 
update(...)
Update a set with the union of itself and another.
Method Details [hide private]

__getattribute__(...)

 

x.__getattribute__('name') <==> x.name

Overrides: object.__getattribute__

__hash__(x)
(Hashing function)

 

hash(x)

Overrides: object.__hash__

__init__(...)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__

__new__(T, S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

__reduce__(...)

 

Return state information for pickling.

Overrides: object.__reduce__

__repr__(x)
(Representation operator)

 

repr(x)

Overrides: object.__repr__

add(...)

 

Add an element to a set.

This has no effect if the element is already present.

difference(...)

 

Return the difference of two sets as a new set.

(i.e. all elements that are in this set but not the other.)

discard(...)

 

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

If the element is not a member, do nothing.

intersection(...)

 

Return the intersection of two sets as a new set.

(i.e. all elements that are in both sets.)

remove(...)

 

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

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

symmetric_difference(...)

 

Return the symmetric difference of two sets as a new set.

(i.e. all elements that are in exactly one of the sets.)

union(...)

 

Return the union of two sets as a new set.

(i.e. all elements that are in either set.)