On Wed, 07 Nov 2007 10:22:27 -0800, Daryl Spitzer wrote:

>     def __cmp__(self, other):
>         if self.value > other.value: return 1
>         if self.value < other.value: return -1
>         return 0

This can be written a bit shorter::

    def __cmp__(self, other):
        return cmp(self.value, other.value)

Ciao,
        Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to