[ZODB-Dev] BTree sets and unhashable objects

Tim Peters tim at zope.com
Wed Jun 18 13:53:23 EDT 2003


[Roché Compaan]
> I was using OOSet for set operations on sequences of objects in the
> ZODB and was getting horrably incorrect results. After I reread the
> Btrees Wiki I noticed that the objects should be hashable,

I don't know which Wiki that refers to (have a URL handy?), but it's wrong:
BTree operations (which include OOSets) never ask for an object's hash code
(Python dicts do, BTrees do not).

> which they weren't of course. Maybe the set classes can be so nice
> as to not accept unhashable objects in the first place and stop
> stupidly forging ahead in its tracks ;-)

The problem is due to something else.  The "real rules" for BTrees are here:

    http://www.zope.org/Wikis/ZODB/guide/node6.html

esp. section 5.3.1, "Total Ordering and Persistence".




More information about the ZODB-Dev mailing list