Guido rethinking removal of cmp from sort method

Terry Reedy tjreedy at
Mon Apr 4 19:26:30 CEST 2011

On 4/4/2011 9:35 AM, Lie Ryan wrote:
> On 04/04/11 19:34, Antoon Pardon wrote:
>> On Fri, Apr 01, 2011 at 10:21:33PM -0400, Terry Reedy wrote:
>>> rewriting cmp_to_key in C is underway
>> Nice to know! Any chance this wil get into 2.7.x?
> Python 2.7 still have list.sort(cmp=...)/sorted(cmp=...), so cmp_to_key
> is not much use there. Just pass your comparison function to the cmp
> argument.

.cmp_to_key was added to ease moving to 3.x or maintaining code usable 
on both. A faster version would encourage such use. But it is not a bug 
fix exactly, and there is always worry that permanance enhancements may 
have unforseen side effects. I will let Raymond make the call on this.

Terry Jan Reedy

More information about the Python-list mailing list