[ZODB-Dev] [BTrees] Inconsistent equality checks

Tim Peters tim at zope.com
Fri Nov 7 18:15:08 EST 2003


[Dieter Maurer]
> That's a nice implementation centric explanation of what I found out.
>
> However, from a semantics point of view "OOSet" and "OOTreeSet"
> are two implementations of the same abstract data type.
> It is therefore surprising that their "keys()" result behave
> semantically different with respect to "==".

I didn't say it wasn't surprising, I pointed out that the documentation
(meaning the formal IReadSequence interface) promises nothing about
comparability of objects implementing IReadSequence -- it only promises that
they support __getitem__ and __getslice__.

So if you just want to share your surprise, no problem; if you want to say
it's a bug, I disagree (it's functioning as documented and designed, and
that comparison acts differently between the cases doesn't bother me any
more-- or less --than that, e.g., OOSet.keys() has an .index() method today
but OOTreeSet.keys() doesn't).




More information about the ZODB-Dev mailing list