classification
Title: list.sort.__doc__ says "cmp" is a keyword, but it isn't.
Type: Stage:
Components: Documentation Versions: Python 3.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: brunogola, dbinger, georg.brandl
Priority: normal Keywords:

Created on 2008-03-14 11:11 by dbinger, last changed 2008-03-14 13:29 by georg.brandl. This issue is now closed.

Messages (4)
msg63521 - (view) Author: David Binger (dbinger) Date: 2008-03-14 11:11
(at revision 61376)

It looks like this docstring needs to be updated.
msg63522 - (view) Author: Bruno Gola (brunogola) Date: 2008-03-14 12:41
i'm using the lastest version from subversion (trunk) and cmp still is a
keyord for list.sort.
msg63524 - (view) Author: David Binger (dbinger) Date: 2008-03-14 13:25
Hi Bruno,
Are you testing py3k?  This is what I see:

  Python 3.0a3+ (py3k:61352M, Mar 12 2008, 13:11:35)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> [].sort(cmp=lambda x, y: 1)
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
TypeError: 'cmp' is an invalid keyword argument for this function
 >>>

In listobject.c, in listsort(), at line 1863, we have
the following, which appears to be where "key" and "reverse"
keyword args are supported, but not "cmp".

	static char *kwlist[] = {"key", "reverse", 0};

	assert(self != NULL);
	assert (PyList_Check(self));
	if (args != NULL) {
		if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oi:sort",

On Mar 14, 2008, at 8:41 AM, Bruno Gola wrote:

>
> Bruno Gola <brunogola@gmail.com> added the comment:
>
> i'm using the lastest version from subversion (trunk) and cmp still  
> is a
> keyord for list.sort.
msg63525 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-03-14 13:29
Thanks, fixed in r61377.
History
Date User Action Args
2008-03-14 13:29:09georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg63525
2008-03-14 13:25:10dbingersetmessages: + msg63524
2008-03-14 12:41:24brunogolasetnosy: + brunogola
messages: + msg63522
2008-03-14 11:11:57dbingercreate