[Python-ideas] Add OrderedSet now that OrderedDict is in collections

Daniel Stutzbach daniel at stutzbachenterprises.com
Sat May 9 15:04:09 CEST 2009


On Sat, May 9, 2009 at 5:17 AM, spir <denis.spir at free.fr> wrote:

> I feel the same. Unorder (like in dict or set) is not a feature, I guess.
> Set is useful for it ensures uniqueness of items, not because of unorder. A
> kind of "unique-item" sequence would do as well.
> Unorder is rather a consequence of hash implementation for performance, but
> I cannot find any use case where it would be a useful feature. Examples
> welcome.
>

Unorder is an absence of a feature, so it will never be "useful".  However,
unorder frees up the implementation to be more efficient since there is less
information to keep track of.

Also, insertion order isn't always the desired order.  For example,
maintaining a sorted list of unique items is often handy.  In other cases, a
different ordering may be useful.

--
Daniel Stutzbach, Ph.D.
President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20090509/a1befea4/attachment.html>


More information about the Python-ideas mailing list