What happened to __cmp__() in Python 3.x?

Mark Lawrence breamoreboy at yahoo.co.uk
Sun Aug 16 11:38:50 CEST 2009


Chris Rebert wrote:
> On Sat, Aug 15, 2009 at 1:06 PM, Mark Lawrence<breamoreboy at yahoo.co.uk> wrote:
>> Xavier Ho wrote:
>>> Hey all,
>>>
>>> I've recently made my way to Python 3.1 and I'm not seeing __cmp__() in
>>> the
>>> documentation.
>>>
>>> Is there a substitution for this special method in 3.1, or do I really
>>> have
>>> to define all six rich comparison methods to work it out?
>>>
>>> If this question has already been asked somewhere, I apologise in advance.
>>> Already googled around but I didn't find information on this.
>>>
>>> Any replies appreciated.
>>>
>> http://bytes.com/topic/python/answers/844614-python-3-sorting-comparison-function
> 
> That seems to be about the built-in function cmp(). The OP was asking
> about the special method __cmp__ and the related rich comparison
> special methods (__eq__, __lt__, etc).
> 
> Cheers,
> Chris
Blast, I posted the wrong flaming link, sorry everybody.

-- 
Kindest regards.

Mark Lawrence.




More information about the Python-list mailing list