classification
Title: cmp argument to list.sort()/sorted() should raise a Py3K warning
Type: Stage:
Components: Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: brett.cannon, collinwinter, jeff.balogh, rhettinger
Priority: critical Keywords: 26backport, patch

Created on 2008-03-17 19:30 by brett.cannon, last changed 2008-03-24 08:40 by rhettinger. This issue is now closed.

Files
File name Uploaded Description Edit
sort-cmp.diff jeff.balogh, 2008-03-19 17:14 diff against r61626
Messages (7)
msg63725 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2008-03-17 19:30
The cmp argument for list.sort() and sorted() should raise a Py3K warning.
msg63748 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2008-03-17 20:00
I've got this one.
msg64014 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2008-03-18 23:33
Checked-in r61576
msg64072 - (view) Author: Jeff Balogh (jeff.balogh) * Date: 2008-03-19 17:14
Fixing the compare to raise the warning when cmp != NULL, and adding a 
test
msg64078 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2008-03-19 17:45
Doh!

Fixed in r61632
msg64096 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2008-03-19 20:45
Collin, is there some place where I should write-up how to transition
sort cmp functions?

Often, it is straight-forward to write a simpler key function, but
sometimes it isn't obvious how to proceed (i.e. cases that have an
ascending primary key and descentding secondary key or cases where a
user supplied cmp function is an unchangable, exposed part of the API).

I would like to issue some guidance on the subject.
msg64110 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2008-03-19 21:51
There's currently no central repository that I know of. We should have
an informational PEP on the subject; would you like to start one with
sort/sorted keys as the seed? I've got some notes I can contribute, and
I'd like to milk Guido for his experience with str/bytes porting.
History
Date User Action Args
2008-03-24 08:40:38rhettingersetstatus: open -> closed
2008-03-19 21:51:08collinwintersetassignee: collinwinter -> rhettinger
messages: + msg64110
2008-03-19 20:45:15rhettingersetstatus: closed -> open
assignee: rhettinger -> collinwinter
messages: + msg64096
nosy: + collinwinter
2008-03-19 17:45:41rhettingersetmessages: + msg64078
2008-03-19 17:14:44jeff.baloghsetfiles: + sort-cmp.diff
nosy: + jeff.balogh
messages: + msg64072
keywords: + patch
2008-03-18 23:33:46rhettingersetstatus: open -> closed
resolution: fixed
messages: + msg64014
2008-03-17 20:17:41brett.cannonsetpriority: release blocker -> critical
versions: + Python 2.6
2008-03-17 20:00:13rhettingersetassignee: rhettinger
messages: + msg63748
nosy: + rhettinger
2008-03-17 19:30:11brett.cannoncreate