
13 Oct
2011
13 Oct
'11
9:06 a.m.
On Wed, Oct 12, 2011 at 11:18 PM, Guido van Rossum guido@python.org wrote:
(I'm also -1 on adding ordering comparisons; there's little disagreement on that issue.)
If I had a time machine, I would allow comparisons to return "unordered" as well. Right now, objects are comparable or not based strictly on the type, even though comparison is inherently about the values.
I think that
range(3) < range(10)
is obviously true, even though it isn't clear whether or not
range(3, 15, 2) < range(7, -8, -1)
is true.
Here we err by not allowing the first comparison; other objects (like dicts) we err by forcing an arbitrary ordering.
-jJ