[ZODB-Dev] BTree corrupted after conflict resolution
Tim Peters
tim at zope.com
Sat Mar 6 00:36:20 EST 2004
[Christian Robottom Reis]
>>> Well, wouldn't that just be a roundabout way of making it explicit
>>> that nothing but simple types can be used as BTree keys (since no
>>> custom __cmp__ can be provided), or are you considering the
>>> zero-concurrency situation? :-)
[Dieter Maurer]
>> No. There is not problem to use class instances as keys,
>> provided they provide a persistent (complete) ordering
>> and they are not persistent.
[Christian]
> Okay. But then how do they provide complete ordering if not via
> __cmp__ or __rcmp__, given that they are instances?
By supplying __cmp__. Your original "since no custom __cmp__ can be
provided" didn't make sense. You can always slap a custom __cmp__ on a
class. It apparently doesn't do any *good* to supply a custom __cmp__ on a
*persistent* class so far as conflict resolution is concerned, but Dieter is
explictly talking about non-persistent classes. It's unclear whether your
original "simple types" did or didn't intend to include non-persistent
classes. Dieter read your "simple types" as not including non-persistent
classes, in which case it's not true that nothing but simple types can be
used as BTree keys. If you did intend to include non-persistent classes
with intelligently defined __cmp__ methods in "simple types", then it is
true that nothing but simple types can [etc].
More information about the ZODB-Dev
mailing list