On Tue, Mar 3, 2020 at 10:43 AM Steve Jorgensen <ste...@stevej.name> wrote:

> Guido van Rossum wrote:
> > I think it’s usually called Orderable. It’s a useful concept in static
> type
> > checking too (e.g. mypy), where we’d use it as an upper bound for type
> > variables, if we had it. I guess to exclude sets you’d have to introduce
> > TotalOrderable.
> >
> Right. That's a much better term. `Orderable` and `ProtoOrderable`.
>

Or even PartialOrderable and Orderable. This would follow Rust's PartialOrd
and Ord (https://doc.rust-lang.org/std/cmp/trait.PartialOrd.html and
https://doc.rust-lang.org/std/cmp/trait.Ord.html).

But beware, IIRC there are pathological cases involving floats, (long) ints
and rounding where transitivity may be violated in Python (though I believe
only Tim Peters can produce an example :-). I'm honestly not sure that
that's enough to sink the idea. (If it were, NaN would be a bigger problem.)

-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@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/OHV2W3HZC3ITKIW7ZCJUKKCT5VJQINWS/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to