[ZODB-Dev] BTree ranges

Tim Peters tim at zope.com
Fri Dec 12 16:06:09 EST 2003


[Christian Robottom Reis]
[Tim Peters, near the start of October]
>> I doubt anyone here uses BTrees indexed by floats.  Luckily for you
>> <wink>, the same problems occur, mutatis mutandis, in BTrees indexed
>> by strings.

[Christian Robottom Reis]
> This is dead and buried, but note that DateTime objects used as keys
> are also converted to floats, and a BTree that allows you to grab all
> values between a certain range of dates isn't such an unexpected use
> case, I hope.

Yup, I was wrong.  It doesn't have any consequence, as floats work fine as
BTree keys, and there was never a plan to drop that.

WRT DateTime, note that Python 2.3's new date and time types do not convert
to floats, and support exact date and time arithmetic.  The number of
endcase bugs in Zope's DateTime type tracked back to dealing inadequately
with that floating-point arithmetic is approximate was pretty depressing.
The Python date and time types can be used as BTree keys too, of course.




More information about the ZODB-Dev mailing list