Comparing objects - is there a maximum object?

Andrew Dalke adalke at mindspring.com
Thu Sep 4 23:09:17 CEST 2003


Martin v. Löwis:
> The easiest way to produce a maximum object is
>
> class Max:
>    def __cmp__(self, other):
>      return 1

Shouldn't there also be a

    def __rcmp__(self, other):
        return -1
?

                    Andrew
                    dalke at dalkescientific.com






More information about the Python-list mailing list