[ZODB-Dev] OOBTree: Persistent Objects as keys
Toby Dickenson
tdickenson@geminidataloggers.com
Wed, 20 Feb 2002 10:05:28 +0000
On Tuesday 19 February 2002 5:39 pm, Jim Fulton wrote:
> There would also be a registry for registering handlers
>for standard types.
Hmm. You are suggesting that the registry/interface is used to derive a
2-parameter comparison function, right?
We would have to pass *both* objects through the registry/interface, and only
proceed if both objects being compared use the *same* comparison function.
Raise an exception if they use a different comparison function.
Then we need to provide several standard comparison function for the standard
orders: integer_number_order, plain_string_dictionary_order, etc. Each
function proceeds by converting both of its operands into the canonical
representation for that order (using long(), str(), etc) and comparing those
using the standard cmp().
I dont see any problem with that.