[Zope-dev] difference between OOSet and OOTreeSet?

Gary Poster gary at zope.com
Thu Mar 1 10:27:47 EST 2007


On Mar 1, 2007, at 9:04 AM, Chris Withers wrote:

> Hi All,
>
> Wondering if someone could tell me the difference between an OOSet  
> and an OOTreeSet?
>
> They seem to have different interfaces and yet seem to be used in  
> similar circumstances in PluginIndexes/common/UnIndex.py...
>
> I'm looking for a set-like data structure which will likely get  
> pretty large over time and so I don't want the whole data structure  
> written to disk each time I add a new item to the set.
>
> What should I be using?

TreeSet.

FWIW, here's an excerpt from the ZODB trunk BTrees/Interface.py

class IBTreeModule(Interface):
     """These are available in all modules (IOBTree, OIBTree,  
OOBTree, IIBTree,
     IFBTree, LFBTree, LOBTree, OLBTree, and LLBTree).
     """

     BTree = Attribute(
         """The IBTree for this module.

         Also available as [prefix]BTree, as in IOBTree.""")

     Bucket = Attribute(
         """The leaf-node data buckets used by the BTree.

         (IBucket is not currently defined in this file, but is  
essentially
         IDictionaryIsh, with the exception of __nonzero__, as of this
         writing.)

         Also available as [prefix]Bucket, as in IOBucket.""")

     TreeSet = Attribute(
         """The ITreeSet for this module.

         Also available as [prefix]TreeSet, as in IOTreeSet.""")

     Set = Attribute(
         """The ISet for this module: the leaf-node data buckets used  
by the
         TreeSet.

         Also available as [prefix]BTree, as in IOSet.""")

Gary


More information about the Zope-Dev mailing list