[ovs-dev] [PATCH 10/11] python: Fix object comparisons in Python 3.

Russell Bryant russell at ovn.org
Tue Feb 2 21:33:22 UTC 2016


On 02/02/2016 04:22 PM, Ben Pfaff wrote:
> On Fri, Jan 22, 2016 at 09:32:32PM -0500, Russell Bryant wrote:
>> Python 3 no longer supports __cmp__.  Instead, we have to implement the
>> "rich comparison" operators.  We implement __eq__ and __lt__ and use
>> functools.total_ordering to implement the rest.
>>
>> In one case, no __cmp__ method was provided and instead relied on the
>> default behavior provided in Python 2.  We have to implement the
>> comparisons explicitly for Python 3.
>>
>> Signed-off-by: Russell Bryant <russell at ovn.org>
> 
> Should this remove the __cmp__ operators?

I thought so, but Python 2 seemed to breaking without them for whatever
reason.  Keeping it made things work everywhere.  Shrug.

> Acked-by: Ben Pfaff <blp at ovn.org>
> 


-- 
Russell Bryant



More information about the dev mailing list