Comparing objects - is there a maximum object?

"Martin v. Löwis" martin at v.loewis.de
Thu Sep 4 21:47:09 CEST 2003


Chris Brew wrote:

> so  (unless this has been superseded) it doesn't seem that there is
> such an object. Any suggestions? 

The easiest way to produce a maximum object is

class Max:
   def __cmp__(self, other):
     return 1
maximum = Max()

HTH,
Martin





More information about the Python-list mailing list