What's more pythonic?

Richard Jones richardjones at optushome.com.au
Wed Sep 13 01:07:44 EDT 2006


Paul Rubin wrote:

> Dan Stromberg <strombrg at dcs.nac.uci.edu> writes:
>> def __cmp__(self, other):
>> if self.a < other.a:
>> return -1
>> elif self.a > other.a:
>> return 1
>> else:
>> return 0
> 
> I think I'd have written
> 
>            return cmp(self.a, other.a)

/me agrees



More information about the Python-list mailing list