[Zope-dev] difference between OOSet and OOTreeSet?

Chris Withers chris at simplistix.co.uk
Thu Mar 1 15:18:27 EST 2007


Gary Poster wrote:
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in ?
>> TypeError: argument to reversed() must be a sequence
> 
> The fact that this works for the OOSet is an implementation accident.
> 
> As discussed elsewhere in this thread, sets are not sequences.  The fact 
> that the elements are ordered is an implementation detail (although 
> given that these sets are essentially the keys of a BTree, it's 
> unsurprising that they are).
> 
> You could argue that reversed(OOSet((1,2,3))) should raise an 
> exception.  IMO, why bother.

*grunt*

Okay, so I want a persistent, ordered sequence which is quick to find 
items in and which doesn't re-store the whole sequence when an item is 
inserted or removed.

What should I be using?

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Zope-Dev mailing list