You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/birkenfeld'closed_at=<Date2008-03-14.13:29:09.555>created_at=<Date2008-03-14.11:11:57.758>labels= ['docs']
title='list.sort.__doc__ says "cmp" is a keyword, but it isn\'t.'updated_at=<Date2008-03-14.13:29:09.539>user='https://bugs.python.org/dbinger'
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".
staticchar*kwlist[] = {"key", "reverse", 0};
assert(self!=NULL);
assert (PyList_Check(self));
if (args!=NULL) {
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oi:sort",
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: