list.sort(): heaviest item?

Steven Clark steven.p.clark at gmail.com
Tue Apr 8 11:38:17 EDT 2008


  >  You can pass a cmp-function that will always make one object being greater
>  than all others.
>
>  Diez
>  --

Yeah, I figured it out 2 minutes after I posted, d'oh!

class Anvil(object):
    def __cmp__(self. other):
        return 1

Sorry for the wasted space.



More information about the Python-list mailing list