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.


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?



Simplistix - Content Management, Zope & Python Consulting
Zope-Dev maillist  -
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to