classification
Title: Argument Clinic generates wrong keyword parameter name for "default"
Type: behavior Stage: resolved
Components: Build Versions: Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: larry Nosy List: larry, python-dev, serhiy.storchaka
Priority: normal Keywords:

Created on 2014-01-07 09:08 by serhiy.storchaka, last changed 2014-01-07 20:22 by larry. This issue is now closed.

Files
File name Uploaded Description Edit
spammodule.c serhiy.storchaka, 2014-01-07 09:08
larry.clinic.keyword.renamer.diff.1.txt larry, 2014-01-07 16:52 review
Messages (4)
msg207513 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-01-07 09:08
For the "default" keyword parameter Argument Clinic generates wrong name "default_value" in the _keywords array.

/*[clinic]
module spam
spam.ham

    default: int = 1

[clinic]*/

...

static PyObject *
spam_ham(PyModuleDef *module, PyObject *args, PyObject *kwargs)
{
    PyObject *return_value = NULL;
    static char *_keywords[] = {"default_value", NULL};
    int default_value = 1;

    if (!PyArg_ParseTupleAndKeywords(args, kwargs,
        "|i:ham", _keywords,
        &default_value))
        goto exit;
...
msg207517 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2014-01-07 09:27
I'll fix this but it's low priority for today.

It's not a release blocker; we could release Python 3.4 with this bug.
msg207561 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2014-01-07 16:52
The problem was an easy fix.  However, while fixing it I discovered another problem (if "[clinic]*/" was the last line, and it didn't have an eol, Clinic would append another "[clinic]*/").  I fixed that too and added a regression test.

Okay?
msg207589 - (view) Author: Roundup Robot (python-dev) Date: 2014-01-07 20:21
New changeset f61c63ec4e70 by Larry Hastings in branch 'default':
Issue #20157: When Argument Clinic renames a parameter because its name
http://hg.python.org/cpython/rev/f61c63ec4e70
History
Date User Action Args
2014-01-07 20:22:10larrysetstatus: open -> closed
resolution: fixed
stage: needs patch -> resolved
2014-01-07 20:21:45python-devsetnosy: + python-dev
messages: + msg207589
2014-01-07 16:52:21larrysetfiles: + larry.clinic.keyword.renamer.diff.1.txt

messages: + msg207561
2014-01-07 09:29:52serhiy.storchakalinkissue20159 dependencies
2014-01-07 09:27:18larrysetpriority: release blocker -> normal
assignee: larry
messages: + msg207517
2014-01-07 09:08:52serhiy.storchakacreate