You are not logged in Log in Join
You are here: Home » Members » ajung » The Hitchhikers Guide To BTrees » DataTypes

Log in
Name

Password

 
 

History for DataTypes

??changed:
-
!BTrees

  - !IIBTree  -- maps integers to integers:

     - Usage: from !BTrees.!IIBTree import !IIBTree

  - !IOBTree -- maps integers to objects:

     - Usage: from !BTrees.!IOBTree import !IOBTree

  - !OIBTtree -- maps  objects to integers:

     - Usage: from !BTrees.!OIBTree import !OIBTree

  - !OOBTree -- maps  objects to objects:

     - Usage: from !BTrees.!OOBTree import !OOBTree

Buckets

  - Buckets behave like !BTree objects and  therefore like
    dictionaries except Buckets do not implement the
    *insert()* method. Buckets are the smallest unit used by ZODB
    to store data. All datastructures consist of one or more
    buckets.

     - Usage: from !BTrees.!IIBTree import !IIBucket
  
     - Usage: from !BTrees.!OOBTree import !OOBucket


Sets

  - !IISet -- set of integers:

     - Usage: from !BTrees.!IIBTree import !IISet

  - !OOSet -- set of objects:

     - Usage: from !BTrees.!OOBTree import !OOSet
 
  **Sets store their data in a single bucket**

!TreeSets

  - !TreeSets behave like normal sets except they do not implement
     __getitem__()

     - Usage: from !BTrees.!IIBTree import !IITreeSet

     - Usage: from !BTrees.!OOBTree import !OOTreeSet


  **!TreeSets store their data in one or more buckets**  Assuming you will store your set in a ZODB, the advantage that a !TreeSet has over a Set is that, after a modification, only changed buckets need to be updated in the database.  This improves efficiency and reduces conflict processing.

<hr solid id=comments_below>