[ZODB-Dev] B-Tree API

Jeremy Hylton jeremy@zope.com (Jeremy Hylton)
Mon, 2 Dec 2002 18:17:12 -0500


>>>>> "GFE" == gfe  <gfe@comit.ch> writes:

  GFE> Any ideas? Ideally, I think a do-nothing sort() method should
  GFE> be provided to achieve compatiblity with dictionaries and
  GFE> PersistentMappings.

This doesn't sound like a very appealing idea.  The items returned by
a BTree are not a list, and I don't see much value in making them look
more like builtin lists (the only object with a sort() method).
Perhaps you could write a sort() helper function that sorted a
sequence in place and then test explicitly for lists in that function.

def sort(seq):
    if isinstance(seq, list):
        seq.sort()
    return seq

Jeremy