[Python-Dev] Std test failures on WIndows: test_compare, test_minidom

Tim Peters tim.one@home.com
Tue, 2 Jan 2001 22:05:59 -0500


[Neil Schemenauer, on a violation of transitivity j < c < i but not j < i]

> To quote Bart Simpson: I didn't do it.  I'm pretty sure the bug
> is in PyInstance_DoBinOp.  I don't think its worth fixing though.
> I'm ready to check in my coercion overhaul patch, assuming no
> veto's from the list.  It should fix this bug (and introduce a
> whole slew of new ones :).

Sounds good to me!

> Guido suggested that I remove the "number types compare smaller
> than other types" behavior.  What's your take on that?  The
> current patch on SF always uses the type names.  It should be
> easy to implement the old behavior though.

It doesn't matter that they're specifically smaller, it matters that they
can't violate transitivity.  "numbers compare smaller" was introduced
deliberately (by Guido) because, e.g., before that we had

    99 < [99] < 99L

despite that 99 == 99L, because

   "int" < "list" < "long int"

Even stranger, we had

    100 < [99] < 0L < 100

and

    100 < [] < -101L < -100


Making numbers compare smaller than other types is one way to ensure stuff
like that can't happen; I can't think of a simpler way (although making them
compare larger than other types would be equally simple, as would making
them compare as if their type name were "Neil" <wink>).