Annoying behaviour of the != operator

Terry Reedy tjreedy at udel.edu
Fri Jun 10 13:10:02 EDT 2005


"Rocco Moretti" <roccomoretti at hotpop.com> wrote in message 
news:d8c9cg$pa7$1 at news.doit.wisc.edu...
> The "wackyness" I refered to wasn't that a list of complex numbers isn't
> sortable, but the inconsistent behaviour of list sorting. As you
> mentioned, an arbitraty collection of objects in a list is sortable, but
> as soon as you throw a complex number in there, you get an exception.

This 'wackyness' is an artifact resulting from Python being 'improved' 
after its original design.  When Guido  added complex numbers as a builtin 
type, he had to decide whethter to make them sortable or not.  There were 
reasons to go either way.  ... and the discussion has continued ever since 
;-)

Terry J. Reedy






More information about the Python-list mailing list