[ZODB-Dev] PersistentMapping good for large numbers of objects?

Steve Alexander steve at cat-box.net
Fri Jul 18 13:59:11 EDT 2003


> Just one more caution:  the app has to be careful to keep the Length object
> up-to-date too.  I suspect it can be easy to forget to fiddle it in lockstep
> along with tree mutations.

For this case, I'd suggest writing a Python wrapper or subclass for 
xxBTree, and have that also manage the Length object. It would present 
the same interface as a BTree, but would route __len__ to the Length 
object, and keep the Length object updated on __setitem__, __delitem__, etc.

Perhaps such a Python class would be a useful addition to the BTrees 
package?

--
Steve Alexander




More information about the ZODB-Dev mailing list