durusmail: durus-users: snag with btree.get(key)
snag with btree.get(key)
2005-07-07
2005-07-07
2005-07-07
2005-07-08
2005-07-08
2005-07-08
2005-07-08
2005-07-08
2005-07-11
2005-07-08
2005-07-08
2005-07-08
2005-07-08
Schevo and moellus [was: Re: [Durus-users] snag with btree.get(key)]
2005-07-11
Re: Schevo and moellus [was: Re: [Durus-users] snag with btree.get(key)]
2005-07-13
2005-07-14
2005-07-14
2005-07-14
2005-07-13
2005-07-07
snag with btree.get(key)
Thomas Guettler
2005-07-08
Am Freitag, 8. Juli 2005 10:56 schrieb Mario Ruggier:
> On Jul 7, 2005, at 8:57 PM, Neil Schemenauer wrote:
> > On Thu, Jul 07, 2005 at 08:55:10PM +0200, Mario Ruggier wrote:
> >> Shall I consider hashing the keys myself? I am not sure what the
> >> implications are to my code...
> >
> > You need to have a __cmp__ method that provides a stable total
> > ordering of the keys.  It must still give the same order after keys
> > are pickled and loaded.
>
> Awesome... that's easy enough!
>
>      def __cmp__(self, other):
>          if self is other:
>              return 0
>          return cmp(self._id, other._id)

Since Durus is very much like ZODB, this link might help, too:

http://www.zope.org/Wikis/ZODB/FrontPage/guide/node6.html#SECTION000630000000000
000000
"5.3 BTrees Package"

 Thomas
reply