[New-bugs-announce] [issue24051] Argument Clinic no longer works with single optional argument

Serhiy Storchaka report at bugs.python.org
Fri Apr 24 15:48:50 CEST 2015


New submission from Serhiy Storchaka:

Argument Clinic no longer works single optional argument. For example see _tkinter.tkapp.wantobjects in the patch in issue20168.

/*[clinic input]
_tkinter.tkapp.wantobjects

    [
    value: int
    ]
    /

[clinic start generated code]*/

It is converted to the methoddef of type METH_O.

#define _TKINTER_TKAPP_WANTOBJECTS_METHODDEF    \
    {"wantobjects", (PyCFunction)_tkinter_tkapp_wantobjects, METH_O, _tkinter_tkapp_wantobjects__doc__},

static PyObject *
_tkinter_tkapp_wantobjects(PyObject *self, PyObject *arg)
{
    PyObject *return_value = NULL;
    int group_right_1 = 0;
    int value = 0;

    if (!PyArg_Parse(arg, "i:wantobjects", &value))
        goto exit;
    return_value = _tkinter_tkapp_wantobjects_impl(self, group_right_1, value);

exit:
    return return_value;
}

As result wantobjects() can't be called without an argument.

----------
components: Argument Clinic
messages: 241943
nosy: larry, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Argument Clinic no longer works with single optional argument
type: behavior
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24051>
_______________________________________


More information about the New-bugs-announce mailing list