[ZODB-Dev] Default comparison considered harmful in BTrees.

Hanno Schlichting hanno at hannosch.eu
Wed Oct 27 11:27:46 EDT 2010


On Wed, Oct 27, 2010 at 3:58 PM, Jim Fulton <jim at zope.com> wrote:
> On Wed, Oct 27, 2010 at 9:17 AM, Hanno Schlichting <hanno at hannosch.eu> wrote:
>> I'm now getting warnings for simple strings and ints, I'd expect
>> tuples as well.
>
> That's odd. I'm not. What platform and Python version?

Python 2.6.6, Mac OS 10.6.4 64bit

> Can you give some examples?

Basically all data structures in the ZCatalog throw warnings now. They
often look like this:

(Pdb) self._index
<BTrees.OOBTree.OOBTree object at 0x107bcf950>
(Pdb) self._index['plone']
<BTrees.IOBTree.IOBTree object at 0x1092eeb50>
(Pdb) self._index['plone'][0]
<BTrees.IIBTree.IITreeSet object at 0x1092eebd0>
(Pdb) [a for a in self._index['plone'][0]]
[1744389888]

I get warnings for lines like:

'string' in self._index
self._index['string'][0] = IITreeSet()

Unless I misunderstood something, none of these use any "bad" keys and
shouldn't throw any warnings.

Hanno


More information about the ZODB-Dev mailing list