class SpecialNumber:

    def __init__(self, i):
        self.number = i

def __repr__(self):
    return '<SpecialNumber(%d)>' % self.number

def __cmp__(self, other):
    return cmp(self.number, other.number)
li = [SpecialNumber(1), SpecialNumber(3), SpecialNumber(2)]
print(min(li))
Python min function with a list of objects