_abcoll :: MutableSet :: Class MutableSet
[hide private]
[frames] | no frames]

Class MutableSet

object --+        
         |        
     Sized --+    
             |    
object --+   |    
         |   |    
  Iterable --+    
             |    
object --+   |    
         |   |    
 Container --+    
             |    
           Set --+
                 |
                MutableSet

A mutable set is a finite, iterable container.

This class provides concrete generic implementations of all methods except for __contains__, __iter__, __len__, add(), and discard().

To override the comparisons (presumably for speed, as the semantics are fixed), all you have to do is redefine __le__ and then the other operations will automatically follow suit.

Nested Classes [hide private]
    Inherited from Sized
  __metaclass__
Metaclass for defining Abstract Base Classes (ABCs).
Instance Methods [hide private]
 
__iand__(self, it)
 
__ior__(self, it)
 
__isub__(self, it)
 
__ixor__(self, it)
 
add(self, value)
Add an element.
 
clear(self)
This is slow (creates N new iterators!) but effective.
 
discard(self, value)
Remove an element.
 
pop(self)
Return the popped value.
 
remove(self, value)
Remove an element.
    Inherited from Set
 
__and__(self, other)
 
__eq__(self, other)
 
__ge__(self, other)
 
__gt__(self, other)
 
__le__(self, other)
 
__lt__(self, other)
 
__ne__(self, other)
 
__or__(self, other)
 
__rand__(self, other)
 
__ror__(self, other)
 
__rsub__(self, other)
 
__rxor__(self, other)
 
__sub__(self, other)
 
__xor__(self, other)
 
_hash(self)
Compute the hash value of a set.
 
isdisjoint(self, other)
Return True if two sets have a null intersection.
    Inherited from Sized
 
__len__(self)
    Inherited from Iterable
 
__iter__(self)
    Inherited from Container
 
__contains__(self, x)
    Inherited from object
 
__delattr__(...)
x.__delattr__('name') <==> del x.name
 
__format__(...)
default object formatter
 
__getattribute__(...)
x.__getattribute__('name') <==> x.name
 
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature
a new object with type S, a subtype of T
__new__(T, S, ...)
 
__reduce__(...)
helper for pickle
 
__reduce_ex__(...)
helper for pickle
 
__repr__(x)
repr(x)
 
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
int
__sizeof__()
size of object in memory, in bytes
 
__str__(x)
str(x)
Class Methods [hide private]
    Inherited from Set
 
_from_iterable(cls, it)
Construct an instance of the class from any iterable input.
    Inherited from Sized
 
__subclasshook__(cls, C)
Abstract classes can override this to customize issubclass().
Class Variables [hide private]
  __abstractmethods__ = frozenset(['__contains__', '__iter__', '...
  _abc_negative_cache = <_weakrefset.WeakSet object at 0x7f28394...
  _abc_negative_cache_version = 2
  _abc_registry = <_weakrefset.WeakSet object at 0x7f2839463650>
    Inherited from Set
  __hash__ = None
hash(x)
    Inherited from Sized
  _abc_cache = <_weakrefset.WeakSet object at 0x7f2839458f90>
Properties [hide private]
    Inherited from object
  __class__
the object's class
Method Details [hide private]

discard(self, value)

 

Remove an element. Do not raise an exception if absent.

pop(self)

 

Return the popped value. Raise KeyError if empty.

remove(self, value)

 

Remove an element. If not a member, raise a KeyError.


Class Variable Details [hide private]

__abstractmethods__

Value:
frozenset(['__contains__', '__iter__', '__len__', 'add', 'discard'])

_abc_negative_cache

Value:
<_weakrefset.WeakSet object at 0x7f2839463710>