Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list.sort.__doc__ says "cmp" is a keyword, but it isn't. #46538

Closed
dbinger mannequin opened this issue Mar 14, 2008 · 4 comments
Closed

list.sort.__doc__ says "cmp" is a keyword, but it isn't. #46538

dbinger mannequin opened this issue Mar 14, 2008 · 4 comments
Assignees
Labels
docs Documentation in the Doc dir

Comments

@dbinger
Copy link
Mannequin

dbinger mannequin commented Mar 14, 2008

BPO 2285
Nosy @birkenfeld

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 = <Date 2008-03-14.13:29:09.555>
created_at = <Date 2008-03-14.11:11:57.758>
labels = ['docs']
title = 'list.sort.__doc__ says "cmp" is a keyword, but it isn\'t.'
updated_at = <Date 2008-03-14.13:29:09.539>
user = 'https://bugs.python.org/dbinger'

bugs.python.org fields:

activity = <Date 2008-03-14.13:29:09.539>
actor = 'georg.brandl'
assignee = 'georg.brandl'
closed = True
closed_date = <Date 2008-03-14.13:29:09.555>
closer = 'georg.brandl'
components = ['Documentation']
creation = <Date 2008-03-14.11:11:57.758>
creator = 'dbinger'
dependencies = []
files = []
hgrepos = []
issue_num = 2285
keywords = []
message_count = 4.0
messages = ['63521', '63522', '63524', '63525']
nosy_count = 3.0
nosy_names = ['georg.brandl', 'dbinger', 'brunogola']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue2285'
versions = ['Python 3.0']

@dbinger
Copy link
Mannequin Author

dbinger mannequin commented Mar 14, 2008

(at revision 61376)

It looks like this docstring needs to be updated.

@dbinger dbinger mannequin assigned birkenfeld Mar 14, 2008
@dbinger dbinger mannequin added the docs Documentation in the Doc dir label Mar 14, 2008
@brunogola
Copy link
Mannequin

brunogola mannequin commented Mar 14, 2008

i'm using the lastest version from subversion (trunk) and cmp still is a
keyord for list.sort.

@dbinger
Copy link
Mannequin Author

dbinger mannequin commented Mar 14, 2008

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.

@birkenfeld
Copy link
Member

Thanks, fixed in r61377.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

1 participant