list.sort(): heaviest item?

Steven Clark steven.p.clark at gmail.com
Tue Apr 8 17:15:07 CEST 2008


If I have a list of items of mixed type, can I put something into it
such that after a list.sort(), is guaranteed to be at the end of the
list?

Looking at http://www.python.org/doc/2.3.5/ref/comparisons.html
"Most other types compare unequal unless they are the same object; the
choice whether one object is considered smaller or larger than another
one is made arbitrarily but consistently within one execution of a
program."

makes me unsure.

It looks like "None" always ends up at the start ("lightest"), but I
want the opposite ("heaviest").

-Steven



More information about the Python-list mailing list