Package Bio :: Package Pathway :: Package Rep :: Module HashSet :: Class HashSet
[hide private]
[frames] | no frames]

Class HashSet

source code

object --+
         |
        HashSet

A set abstraction supporting the basic set operations.

This implementation requires that all elements are hashable, which implies that elements must not mutate while contained.

Instance Methods [hide private]
 
__init__(self, elements=[])
Initializes a new HashSet.
source code
 
__contains__(self, element)
Returns true iff this set contains element.
source code
 
__eq__(self, set)
Returns true iff x == y for all elements in self, set.
source code
 
__len__(self)
Returns the number of elements in this set.
source code
 
__ne__(self, set)
Returns true iff this set is not equal to set.
source code
 
__repr__(self)
Returns a debugging string representation of this set.
source code
 
__str__(self)
Returns a string representation of this set.
source code
 
add(self, element)
Adds element to this set.
source code
 
contains(self, element)
Returns true iff this set contains element.
source code
 
remove(self, element)
Removes element from this set.
source code
 
list(self)
Returns the elements of this set in a list.
source code
 
empty(self)
Returns true iff this set is empty.
source code
 
union(self, s)
Returns the union of this set and s.
source code
 
intersection(self, s)
Returns the intersection of this set and s.
source code
 
difference(self, s)
Returns the difference of this set and s.
source code
 
cartesian(self, s)
Returns the Cartesian product of this set and s.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, elements=[])
(Constructor)

source code 

Initializes a new HashSet.

Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

Returns a debugging string representation of this set.

Overrides: object.__repr__

__str__(self)
(Informal representation operator)

source code 

Returns a string representation of this set.

Overrides: object.__str__