Python 3.0, rich comparisons and sorting order

Carlos Ribeiro carribeiro at gmail.com
Wed Sep 22 03:53:03 CEST 2004


On Wed, 22 Sep 2004 01:08:05 GMT, Cameron Laird <claird at lairds.us> wrote:
> In article <mailman.3672.1095792078.5135.python-list at python.org>,
> Carlos Ribeiro  <carribeiro at gmail.com> wrote:
> >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...
>                         .
>                         .
>                         .
> I thought I understood this thread, but now I'm *really* confused.
> Yes, mathematicians talk about partial orders.  Mr. Ribeiro, I know
> you have good ideas.  Are you saying that you do want Python to
> implement topological orders over all input sequences?  In principle,
> I guess that's feasible.  It strikes me as a specialty item; we're
> all probably best off to build in sorting as it is now, and leave
> toposorts to those who need them.  I don't particularly think they'd
> confuse the masses.  I just figure Pythonia's energy is better ap-
> plied elsewhere.

No, I was not talking seriously. I was partly joking with Albert's assertion:

"If the objects cannot be compared then there is no reasonable result."

..because in topological sorting it's indeed possible to sort a set
where some items can't be directly compared, and the result is
reasonable. But I did not intend that to be taken as a serious
proposition for Python.

(in fact, I've stated that's "really dangerous to make assertions
regarding what's reasonable or not with regards to sorting". I should
have listened to my own advice :-) )

-- 
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