This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients docs@python, terry.reedy
Date 2011-03-29.19:28:41
SpamBayes Score 2.3979783e-09
Marked as misclassified No
Message-id <1301426922.02.0.157603577623.issue11712@psf.upfronthosting.co.za>
In-reply-to
Content
l=[1,3,2]
l.sort(cmp=lambda x,y:y-x, key=lambda x: x)
print(l)

With CPython 2.7 this
1) could raise an exception like TypeError: conflicting arguments passed;
2) could ignore cmp= and print [1,2,3] on the basis that the new should override the old;
3) does ignore key= and prints [3,2,1] (why does not matter now),
but as near as I can tell, this is not documented.

Suggestion: in 5.6.4. Mutable Sequence Types, in footnote 8, after
"key specifies a function of one argument that is used to extract a comparison key from each list element: key=str.lower. The default value is None."
add "Ignored if *cmp* is also given."
History
Date User Action Args
2011-03-29 19:28:42terry.reedysetrecipients: + terry.reedy, docs@python
2011-03-29 19:28:42terry.reedysetmessageid: <1301426922.02.0.157603577623.issue11712@psf.upfronthosting.co.za>
2011-03-29 19:28:41terry.reedylinkissue11712 messages
2011-03-29 19:28:41terry.reedycreate