[ZODB-Dev] B-Tree API

gfe@comit.ch gfe@comit.ch
Sun, 1 Dec 2002 15:00:15 +0100


Dear all,

we have converted some PersistentMappings in our ZODBs to OOBTrees. Now w=
e
are looking for solutions to the following problem:

We frequently use sort() on keys() returned by PersistentMapping. The
OOBTreeItems object returned by keys() on OOBTree doesn't provide a sort(=
)
method, as it is already sorted.

I would like to provide a dummy sort method, but I can neither inherit fr=
om
OOBTree (del fails, the __delitem__ method isn't inherited) nor easily
delegate to it (the special methods such as __delitem__ are not exposed).
Delegation would also involve an additional object and hence overhead. I
would need to return a list over OOBTreeItems, depriving the light-weight
iteration capability of OOBTreeItems.

Any ideas? Ideally, I think a do-nothing sort() method should be provided=
 to
achieve compatiblity with dictionaries and PersistentMappings.

Thank you and best regards,
Martin Gfeller

_______________________

COMIT Gruppe
Risk Advice Services
Pflanzschulstrasse 7
CH-8004 Z=FCrich

http://www.comit.ch
http://www.quantax.com - Quantax Professional - Downsized Trading and Ris=
k
System