[Python-Dev] Re: lists v. tuples

Greg Ewing greg@cosc.canterbury.ac.nz
Mon, 17 Mar 2003 11:45:40 +1200 (NZST)

Alex Martelli <aleax@aleax.it>:

> So, lists whose elements have LESS in common (by being of
> widely different types) are more likely to be sortable than lists
> some of whose elements have in common the fact of being
> numbers (if one or more of those numbers are complex).

As I think I've mentioned before, Python really needs
two different kinds of comparison: one which does whatever
makes sense for objects of compatible types (and which
need not be supported by all types), and another which
imposes an arbitrary order on all objects.

When sorting a list, you would have to specify which
kind of ordering you wanted.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg@cosc.canterbury.ac.nz	   +--------------------------------------+