On Mar 4, 2020, at 10:09 AM, David Mertz <mertz@gnosis.cx> wrote:
This thread feels very much like a solution looking for a problem.
But on one narrow point, I'm trying to think of everything in the standard library or builtins that actually forms a total order with elements of the same type.
* Not floats * I think not strings with unicode canonical equivalence, decomposition, and normalization * Definitely not sets, tuples, lists, dicts, etc. * Arguably not Decimal because it is sensitive to decimal context * Complex clearly not * I think not datetimes under timezone issues (although any ordering is certainly *wrong* given the vagaries of timezones) * Queues, deques, etc. don't even try, nor should they * Do array.array's lack even a partial order?
So really I think we are left with wanting a test for whether something is "int or Fraction".
I think strings do have the Total Order property, because string equality & etc does NOT get into the issues of Unicode canonical equivalence, I.e. the equality test is that they are the same sequence of code points, ignoring that multiple sequences of code points might be represent the same same canonical character, in part because there isn’t a single definition of that, as there is NFD/NFC and NFKD/NFKC equivalences which are different.