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

Class set

object --+
         |
        set

set() -> new empty set object set(iterable) -> new 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
 
__iand__(x, y)
x&y
new empty set object
__init__()
x.__init__(...) initializes x; see help(type(x)) 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
size of S in memory, in bytes
__sizeof__(S)
 
__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 or more 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 or more sets as a new set.
 
intersection_update(...)
Update a set with the intersection of itself and another.
 
isdisjoint(...)
Return True if two sets have a null intersection.
 
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 sets as a new set.
 
update(...)
Update a set with the union of itself and others.

Inherited from object: __delattr__, __format__, __reduce_ex__, __setattr__, __str__, __subclasshook__

Class Variables [hide private]
  __hash__ = None
hash(x)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__getattribute__(...)

 

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

Overrides: object.__getattribute__

__init__()
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Returns: new empty set object
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__

__sizeof__(S)

 
Returns: size of S in memory, in bytes
Overrides: object.__sizeof__

add(...)

 

Add an element to a set.

This has no effect if the element is already present.

difference(...)

 

Return the difference of two or more sets as a new set.

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

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 or more sets as a new set.

(i.e. elements that are common to all of the sets.)

pop(...)

 

Remove and return an arbitrary set element. Raises KeyError if the set is empty.

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 sets as a new set.

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