New submission from Serhiy Storchaka:
Argument Clinic uses original name of Python parameter in generated code for
custom (format code "O&") converter even if the parameter was renamed.
Example:
/*[clinic input]
test
filename as path: object(converter="PyUnicode_FSConverter")
/
[clinic start generated code]*/
Generated code:
static PyObject *
test(PyModuleDef *module, PyObject *arg)
{
PyObject *return_value = NULL;
PyObject *path;
if (!PyUnicode_FSConverter(arg, &filename))
goto exit;
return_value = test_impl(module, path);
exit:
return return_value;
}
----------
components: Argument Clinic
messages: 264606
nosy: larry, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Argument Clinic incorrectly work with custom converter and renamed
parameter
type: behavior
versions: Python 3.5, Python 3.6
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue26902>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com