[ZODB-Dev] BTrees questions
Toby Dickenson
tdickenson@geminidataloggers.com
Wed, 19 Dec 2001 15:30:16 +0000
On Wednesday 19 December 2001 2:59 pm, Jim Fulton wrote:
>BTree data structures certainly rely on sorting, which implies that
>keys must be orderable in a consistent fashion. This is inherent
>in the underlying algorithm. Given that the algorithm is based on
>ordering, using unordered keys is certainly something to worry about.
>Using integer and string keys is certainly worth worrying about.
>The problem here, however, is in the use of BTrees, not in BTrees
>themselves.
Agreed.
The potential real-world problem here relates to Zope's Catalog, which
happily indexes whatever values it finds in an object's attributes without
constraining type. My member account on zope.org lets me change my object's
'Title' attribute to an integer today, which will break the whole index after
upgrading to 2.2 (whenever that happens)
>Perhaps Python should not be so ready to order things in meaningless
>ways.
Indeed.
This is one area that C++ got right.