[ZCM] [ZC] 1829/ 1 Request "bug in IISet.minKey(maxKey)"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Fri Jul 1 05:35:53 EDT 2005


Issue #1829 Update (Request) "bug in IISet.minKey(maxKey)"
 Status Pending, Zope/bug medium
To followup, visit:
  http://www.zope.org/Collectors/Zope/1829

==============================================================
= Request - Entry #1 by suvit on Jul 1, 2005 5:35 am

>>> from BTrees.IIBTree import IISet, IITreeSet
>>> iset = IISet(range(10))
>>> iset.minKey(15)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: empty bucket
>>> iset.keys(15)
[]
>>> iset.keys(5,15)
[5, 6, 7, 8, 9]
>>> iset.maxKey(5)
5
>>> iset.maxKey(-5)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: empty bucket
>>> itset = IITreeSet()
>>> itset = IITreeSet(range(10))
>>> itset.minKey(15)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: empty tree
>>> itset.minKey(10)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: empty tree
>>> itset.minKey(9)
9
>>> itset.minKey(-5)
0
but based on IKeyed Interface IISet or IITreeSet objects must return the smallest key >= min ( largest key <= max) not ValueError.

this bug is similar to http://www.zope.org/Collectors/Zope/99
==============================================================



More information about the Zope-Collector-Monitor mailing list