[New-bugs-announce] [issue20196] Argument Clinic generates invalid code for optional parameter

Serhiy Storchaka report at bugs.python.org
Wed Jan 8 22:17:00 CET 2014


New submission from Serhiy Storchaka:

Argument Clinic generates invalid code for optional parameter if there are no mandatory parameters except self. Example:

/*[clinic input]
zlib.Decompress.flush

    self: self(type="compobject *")
    [
    length: uint
        the initial size of the output buffer.
    ]
    /

Return a bytes object containing any remaining decompressed data.
[clinic start generated code]*/

Generates:

...
    switch (PyTuple_Size(args)) {
        case 0:
            if (!PyArg_ParseTuple(args, ":flush", ))
                return NULL;
            break;
...

Note a comma in PyArg_ParseTuple.

----------
components: Build
messages: 207700
nosy: larry, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Argument Clinic generates invalid code for optional parameter
versions: Python 3.4

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


More information about the New-bugs-announce mailing list