Skip to content

Argument Clinic: a lone optional group generates METH_O #155266

Description

@serhiy-storchaka

Bug report

If the only parameter of a function is in an optional group, Argument Clinic generates METH_O:

/*[clinic input]
m.f
    [
    a: object
    ]
    /
[clinic start generated code]*/

#define M_F_METHODDEF    \
    {"f", (PyCFunction)m_f, METH_O, m_f__doc__},

static PyObject *
m_f(PyObject *module, int group_right_1, PyObject *a)

The group is ignored: the argument becomes mandatory, and group_right_1 is never computed nor passed.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions