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)
  __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
list items - A list of the items which are in the set

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
Type:
list

Generated by Epydoc 1.1 on Sat Jun 21 20:52:28 2003 http://epydoc.sf.net