Chris Withers wrote:
> 
> Martin Aspeli wrote:
>> 
>> 
>> I'll bet one is backed by a hashtable and the other is backed by an r/b
>> tree, meaning the Set is O(1) lookups, possibly a bit less space
>> efficient
>> and non-ordered, 
> 
> Well, Set's are definitely ordered, same as normal python sets...
> 

>From http://docs.python.org/lib/types-set.html:

"A set object is an unordered collection of immutable values."

Which makes sense. Sets in the mathematical sense are not ordered either,
nor are sets in other languages (notably Java's Collections API), nor is
zope.schem.Set. Tuples and Lists are ordered.

Sets may turn out to be *sorted* if they're implemented with trees, but I
don't think the implementation promises that either.

Martin

-- 
View this message in context: 
http://www.nabble.com/difference-between-OOSet-and-OOTreeSet--tf3327097.html#a9254167
Sent from the Zope - Dev mailing list archive at Nabble.com.

_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to