Python 3.0, rich comparisons and sorting order

Carlos Ribeiro carribeiro at gmail.com
Tue Sep 21 14:41:08 EDT 2004


On Tue, 21 Sep 2004 14:26:54 -0400, Istvan Albert
<ialbert at mailblocks.com> wrote:
> If the objects cannot be compared then there is no
> reasonable result. Getting them back in whatever order is not one.
> You're better off not sorting then. If half of your objects are
> sortable and the rest are not what should the result be?

Well, there is a sizeable chunk of mathemathical theory dealing with
sorting things that can't be directly compared -- google for
topological sorting. It's used, for example, in graph theory. But
that's off topic, I've mentioned it just to point to you that it's
really dangerous to make assertions regarding what's reasonable or not
with regards to sorting...


-- 
Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: carribeiro at gmail.com
mail: carribeiro at yahoo.com



More information about the Python-list mailing list