Package dns :: Module rdataset :: Class SimpleSet
[show private | hide private]
[frames | no frames]

Class SimpleSet

object --+
         |
        SimpleSet

Known Subclasses:
Rdataset

A very simple set class.

Sets are not in Python until 2.3, and we also don't have a hash function for rdata which deals with name equivalence, so if we use a set based on dictionaries we could end up with a set which contained objects that were equal. To avoid all of this trouble, we have our own simple set class. It implements a subset of the 2.3 Set interface using a list.
Method Summary
  __init__(self)
Initialize the set, making it empty.
  __eq__(self, other)
  __getstate__(...)
  __iter__(self)
  __len__(self)
  __ne__(self, other)
a new object with type S, a subtype of T __new__(S, ...)
  add(self, item)
Add an item to the set.
  clear(self)
Make the set empty.
  update(self, other)
Update the set, adding any elements from other which are not already in the set.

Instance Variable Summary
  items - A list of the items which are in the set

Class Variable Summary
list __slots__
list items

Method Details

__init__(self)
(Constructor)

Initialize the set, making it empty.

__new__(S, ...)

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

add(self, item)

Add an item to the set.

clear(self)

Make the set empty.

update(self, other)

Update the set, adding any elements from other which are not already in the set.
Parameters:
other - the collection of items with which to update the set
           (type=any iterable type)

Instance Variable Details

items

A list of the items which are in the set

Class Variable Details

__slots__

Type:
list
Value:
['items']                                                              

items

Type:
list
Value:
<member 'items' of 'SimpleSet' objects>                                

Generated by Epydoc 1.1 on Sat Jul 19 02:54:31 2003 http://epydoc.sf.net