On Sun, Dec 15, 2019 at 11:28 PM Raymond Hettinger <
[email protected]> wrote:

> * The corresponding mathematical concept is unordered and it would be
> weird to impose such as order.
>

I'm with Raymond in not wanting sets to maintain insertion (or any) order.
Even though I don't doubt that Larry--and no doubt other folks, from time
to time--have a use for an "ordered set," I feel like it is bad practice to
encourage that way of thinking about sets and using them.

Admittedly, I was only lukewarm about making an insertion-order guarantee
for dictionaries too.  But for sets I feel more strongly opposed.  Although
it seems unlikely now, if some improved implementation of sets had the
accidental side effects of making them ordered, I would still not want that
to become a semantic guarantee.

That said, having OrderedSet in collections module would be fine by me.  It
might have different performance characteristics, but so what? It would be
a different class that folks could use or not, depending on how they felt
about its behavior and performance profile.


-- 
Keeping medicines from the bloodstreams of the sick; food
from the bellies of the hungry; books from the hands of the
uneducated; technology from the underdeveloped; and putting
advocates of freedom in prisons.  Intellectual property is
to the 21st century what the slave trade was to the 16th.
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/G5VFFODDT5N2HNWCTAKUEDDXJJVX7VDJ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to