diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-04-03 21:12:11 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-04-03 21:12:11 (GMT) |
commit | 92e8af67a89b204efedad3373c292c0b3c52072c (patch) | |
tree | 0e319cfdf2015aedc0e932c2a30ad71734aa0824 /Python/clinic | |
parent | 1009bf18b38a8d36298575191dd8fdf43f8f9097 (diff) | |
download | cpython-92e8af67a89b204efedad3373c292c0b3c52072c.zip cpython-92e8af67a89b204efedad3373c292c0b3c52072c.tar.gz cpython-92e8af67a89b204efedad3373c292c0b3c52072c.tar.bz2 |
Issue #23492: Argument Clinic now generates argument parsing code with
PyArg_Parse instead of PyArg_ParseTuple if possible.
Diffstat (limited to 'Python/clinic')
-rw-r--r-- | Python/clinic/bltinmodule.c.h | 8 | ||||
-rw-r--r-- | Python/clinic/import.c.h | 38 |
2 files changed, 23 insertions, 23 deletions
diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h index cc26155..0bd859d 100644 --- a/Python/clinic/bltinmodule.c.h +++ b/Python/clinic/bltinmodule.c.h @@ -109,18 +109,18 @@ PyDoc_STRVAR(builtin_chr__doc__, "Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff."); #define BUILTIN_CHR_METHODDEF \ - {"chr", (PyCFunction)builtin_chr, METH_VARARGS, builtin_chr__doc__}, + {"chr", (PyCFunction)builtin_chr, METH_O, builtin_chr__doc__}, static PyObject * builtin_chr_impl(PyModuleDef *module, int i); static PyObject * -builtin_chr(PyModuleDef *module, PyObject *args) +builtin_chr(PyModuleDef *module, PyObject *arg) { PyObject *return_value = NULL; int i; - if (!PyArg_ParseTuple(args, + if (!PyArg_Parse(arg, "i:chr", &i)) goto exit; @@ -656,4 +656,4 @@ builtin_issubclass(PyModuleDef *module, PyObject *args) exit: return return_value; } -/*[clinic end generated code: output=2da46de189e48d26 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=12db4cde92eb11b3 input=a9049054013a1b77]*/ diff --git a/Python/clinic/import.c.h b/Python/clinic/import.c.h index 7618577..4995d89 100644 --- a/Python/clinic/import.c.h +++ b/Python/clinic/import.c.h @@ -122,18 +122,18 @@ PyDoc_STRVAR(_imp_init_builtin__doc__, "Initializes a built-in module."); #define _IMP_INIT_BUILTIN_METHODDEF \ - {"init_builtin", (PyCFunction)_imp_init_builtin, METH_VARARGS, _imp_init_builtin__doc__}, + {"init_builtin", (PyCFunction)_imp_init_builtin, METH_O, _imp_init_builtin__doc__}, static PyObject * _imp_init_builtin_impl(PyModuleDef *module, PyObject *name); static PyObject * -_imp_init_builtin(PyModuleDef *module, PyObject *args) +_imp_init_builtin(PyModuleDef *module, PyObject *arg) { PyObject *return_value = NULL; PyObject *name; - if (!PyArg_ParseTuple(args, + if (!PyArg_Parse(arg, "U:init_builtin", &name)) goto exit; @@ -150,18 +150,18 @@ PyDoc_STRVAR(_imp_init_frozen__doc__, "Initializes a frozen module."); #define _IMP_INIT_FROZEN_METHODDEF \ - {"init_frozen", (PyCFunction)_imp_init_frozen, METH_VARARGS, _imp_init_frozen__doc__}, + {"init_frozen", (PyCFunction)_imp_init_frozen, METH_O, _imp_init_frozen__doc__}, static PyObject * _imp_init_frozen_impl(PyModuleDef *module, PyObject *name); static PyObject * -_imp_init_frozen(PyModuleDef *module, PyObject *args) +_imp_init_frozen(PyModuleDef *module, PyObject *arg) { PyObject *return_value = NULL; PyObject *name; - if (!PyArg_ParseTuple(args, + if (!PyArg_Parse(arg, "U:init_frozen", &name)) goto exit; @@ -178,18 +178,18 @@ PyDoc_STRVAR(_imp_get_frozen_object__doc__, "Create a code object for a frozen module."); #define _IMP_GET_FROZEN_OBJECT_METHODDEF \ - {"get_frozen_object", (PyCFunction)_imp_get_frozen_object, METH_VARARGS, _imp_get_frozen_object__doc__}, + {"get_frozen_object", (PyCFunction)_imp_get_frozen_object, METH_O, _imp_get_frozen_object__doc__}, static PyObject * _imp_get_frozen_object_impl(PyModuleDef *module, PyObject *name); static PyObject * -_imp_get_frozen_object(PyModuleDef *module, PyObject *args) +_imp_get_frozen_object(PyModuleDef *module, PyObject *arg) { PyObject *return_value = NULL; PyObject *name; - if (!PyArg_ParseTuple(args, + if (!PyArg_Parse(arg, "U:get_frozen_object", &name)) goto exit; @@ -206,18 +206,18 @@ PyDoc_STRVAR(_imp_is_frozen_package__doc__, "Returns True if the module name is of a frozen package."); #define _IMP_IS_FROZEN_PACKAGE_METHODDEF \ - {"is_frozen_package", (PyCFunction)_imp_is_frozen_package, METH_VARARGS, _imp_is_frozen_package__doc__}, + {"is_frozen_package", (PyCFunction)_imp_is_frozen_package, METH_O, _imp_is_frozen_package__doc__}, static PyObject * _imp_is_frozen_package_impl(PyModuleDef *module, PyObject *name); static PyObject * -_imp_is_frozen_package(PyModuleDef *module, PyObject *args) +_imp_is_frozen_package(PyModuleDef *module, PyObject *arg) { PyObject *return_value = NULL; PyObject *name; - if (!PyArg_ParseTuple(args, + if (!PyArg_Parse(arg, "U:is_frozen_package", &name)) goto exit; @@ -234,18 +234,18 @@ PyDoc_STRVAR(_imp_is_builtin__doc__, "Returns True if the module name corresponds to a built-in module."); #define _IMP_IS_BUILTIN_METHODDEF \ - {"is_builtin", (PyCFunction)_imp_is_builtin, METH_VARARGS, _imp_is_builtin__doc__}, + {"is_builtin", (PyCFunction)_imp_is_builtin, METH_O, _imp_is_builtin__doc__}, static PyObject * _imp_is_builtin_impl(PyModuleDef *module, PyObject *name); static PyObject * -_imp_is_builtin(PyModuleDef *module, PyObject *args) +_imp_is_builtin(PyModuleDef *module, PyObject *arg) { PyObject *return_value = NULL; PyObject *name; - if (!PyArg_ParseTuple(args, + if (!PyArg_Parse(arg, "U:is_builtin", &name)) goto exit; @@ -262,18 +262,18 @@ PyDoc_STRVAR(_imp_is_frozen__doc__, "Returns True if the module name corresponds to a frozen module."); #define _IMP_IS_FROZEN_METHODDEF \ - {"is_frozen", (PyCFunction)_imp_is_frozen, METH_VARARGS, _imp_is_frozen__doc__}, + {"is_frozen", (PyCFunction)_imp_is_frozen, METH_O, _imp_is_frozen__doc__}, static PyObject * _imp_is_frozen_impl(PyModuleDef *module, PyObject *name); static PyObject * -_imp_is_frozen(PyModuleDef *module, PyObject *args) +_imp_is_frozen(PyModuleDef *module, PyObject *arg) { PyObject *return_value = NULL; PyObject *name; - if (!PyArg_ParseTuple(args, + if (!PyArg_Parse(arg, "U:is_frozen", &name)) goto exit; @@ -320,4 +320,4 @@ exit: #ifndef _IMP_LOAD_DYNAMIC_METHODDEF #define _IMP_LOAD_DYNAMIC_METHODDEF #endif /* !defined(_IMP_LOAD_DYNAMIC_METHODDEF) */ -/*[clinic end generated code: output=087a1f22e9febcc7 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d41c392510815c5b input=a9049054013a1b77]*/ |