[ZODB-Dev] btree.minKey

Christian Theune ct at gocept.com
Wed Jan 24 05:36:40 EST 2007


Am Mittwoch, den 24.01.2007, 10:59 +0100 schrieb Christian Theune:
> Am Dienstag, den 23.01.2007, 13:30 -0800 schrieb Simon Burton:
> > btree.minKey(t) is documented* to return the smallest key at least
> > as big as t. It seems that if there is no such element it
> > returns the maximum key. 
> 
> 
> So if my set is [1,2] and I do minKey(3) i get 2?

A quick test shows me that this doesn't happen:


>>> from BTrees.IFBTree import IFTreeSet
>>> x = IFTreeSet([1,2])
>>> x.minKey
<built-in method minKey of BTrees._IFBTree.IFTreeSet object at
0xb7cf0614>
>>> x.minKey(3)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: no key satisfies the conditions
>>> x.minKey(2)
2
>>> x.minKey(1)
1
>>> 

-- 
gocept gmbh & co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - ct at gocept.com - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://mail.zope.org/pipermail/zodb-dev/attachments/20070124/60c07194/attachment.bin


More information about the ZODB-Dev mailing list