Really the point about partial order was EXACTLY the thread.
If you want to say that floating point numbers are not ordered for exactly the same reason, and in exactly the same way, as sets... well, I guess you can die on that hill. Since NaN is an IEEE-854 value, everything you mention is precisely identical of floats.
Is your argument that we need to stop using the '<' operator for floats also?!
On Thu, Dec 26, 2019 at 4:31 PM Marco Sulla via Python-ideas < python-ideas@python.org> wrote:
Andrew Barnert wrote:
I didn’t want to get into that, because I assumed you weren’t going to
argue that
<= makes sense for sets but < doesn’t
So you're telling about **strict** partial ordering. I can spend thousand of words, but I think Python can speak for me:
(venv) marco@buzz:~/sources/tests/more_itertools$ python3.9 Python 3.9.0a0 (heads/master-dirty:d8ca2354ed, Oct 30 2019, 20:25:01) [GCC 9.2.1 20190909] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import random >>> a = [set(), {1}, {2}, {3}, {1, 4}, {1, 4}, {3, 7}, {3, 7, 10}, {10}] >>> random.shuffle(a) >>> sorted(a) [set(), {3}, {10, 3, 7}, {2}, {1, 4}, {10}, {3, 7}, {1}, {1, 4}] >>> random.shuffle(a) >>> sorted(a) [set(), {3, 7}, {1}, {10}, {3}, {10, 3, 7}, {1, 4}, {1, 4}, {2}] >>> random.shuffle(a) >>> sorted(a) [set(), {3, 7}, {1}, {10}, {3}, {1, 4}, {1, 4}, {10, 3, 7}, {2}] >>> random.shuffle(a) >>> sorted(a) [set(), {1}, {10}, {3}, {2}, {3, 7}, {10, 3, 7}, {1, 4}, {1, 4}] >>> random.shuffle(a) >>> sorted(a) [set(), {2}, {3, 7}, {1}, {1, 4}, {10}, {3}, {10, 3, 7}, {1, 4}]
Notice the positions of the two {1, 4} sets......
SOooooo.... sorted(sets) does **not** sort at all. Total, partial, so and so, nothing.
Can we now stop please this OT and return to the thread? _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/MOTB2K... Code of Conduct: http://python.org/psf/codeofconduct/