Incomparable abominations

Tim Peters tim_one at email.msn.com
Tue Mar 25 05:05:17 CET 2003


[Tim]
> Yes, but what of it?  Do you actually sort lists containing
> complex numbers?  If so, I do believe you'll be the first to
> claim such a hobby.

[Niki Spahiev]
> I do. It's easiest way to get point on the convex hull of point set.
> (point === complex).

Except that isn't true.  If Python compared complex numbers
lexicographically (as it used to do), then the easiest way to get a point on
the convex hull would be to do min(list_of_complex) or max(list_of_complex).
Sorting isn't necessary for this, and would be far less efficient than the
min/max ways.  If you want to go on to compute the whole convex hull, then
you may need to sort using a different ordering gimmick than lexicographic
(e.g., Graham's algorithm sorts the points using relative phase as the
primary key).






More information about the Python-list mailing list