What's the value of "None" between 2.1.1 and 1.5.2

Huaiyu Zhu huaiyu at gauss.almadan.ibm.com
Mon Dec 3 20:06:48 CET 2001


On Fri, 30 Nov 2001 13:10:37 -0500, Tim Peters <tim.one at home.com> wrote:

>  After that, backward compatibility kicked in (e.g., there are many
>complaints that non-equality comparison of complex numbers now raises an
>exception, and despite that the result we used to return didn't make much
>sense).

Maybe I'm reading too much into this (backward compatibility): does it imply
that sort() works with complex numbers in 2.2?  (I have not tried 2.2 and I
have not found it in the overview docs.)  That would be good.

Excluding complex numbers in sort() does not sound right when the following
is regarded necessary evil (happens often when a number is read from file):

>>> if a < b: print a, '<', b
... 
1 < 0

It seems to me that the opposite rule is more reasonable:
- sort() works for any objects (using default total order when necessary).
- '<' and friends only work for explicitly defined types (a partial order).


Huaiyu



More information about the Python-list mailing list