diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-01-17 00:35:17 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2017-01-17 00:35:17 (GMT) |
commit | 259f0e4437ed30036578aba822560feb531b7735 (patch) | |
tree | 2ed9ead4992b791c76e1d52e0db3d1cd0516ec11 /Modules/clinic/unicodedata.c.h | |
parent | 0c8c3893ae29fab8ce9db0c2f5b52acbe89032e1 (diff) | |
download | cpython-259f0e4437ed30036578aba822560feb531b7735.zip cpython-259f0e4437ed30036578aba822560feb531b7735.tar.gz cpython-259f0e4437ed30036578aba822560feb531b7735.tar.bz2 |
Run Argument Clinic: METH_VARARGS=>METH_FASTCALL
Issue #29286. Run Argument Clinic to get the new faster METH_FASTCALL calling
convention for functions using only positional arguments.
Diffstat (limited to 'Modules/clinic/unicodedata.c.h')
-rw-r--r-- | Modules/clinic/unicodedata.c.h | 52 |
1 files changed, 36 insertions, 16 deletions
diff --git a/Modules/clinic/unicodedata.c.h b/Modules/clinic/unicodedata.c.h index e8a73b9..c3a5910 100644 --- a/Modules/clinic/unicodedata.c.h +++ b/Modules/clinic/unicodedata.c.h @@ -13,23 +13,27 @@ PyDoc_STRVAR(unicodedata_UCD_decimal__doc__, "ValueError is raised."); #define UNICODEDATA_UCD_DECIMAL_METHODDEF \ - {"decimal", (PyCFunction)unicodedata_UCD_decimal, METH_VARARGS, unicodedata_UCD_decimal__doc__}, + {"decimal", (PyCFunction)unicodedata_UCD_decimal, METH_FASTCALL, unicodedata_UCD_decimal__doc__}, static PyObject * unicodedata_UCD_decimal_impl(PyObject *self, int chr, PyObject *default_value); static PyObject * -unicodedata_UCD_decimal(PyObject *self, PyObject *args) +unicodedata_UCD_decimal(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int chr; PyObject *default_value = NULL; - if (!PyArg_ParseTuple(args, "C|O:decimal", + if (!_PyArg_ParseStack(args, nargs, "C|O:decimal", &chr, &default_value)) { goto exit; } + + if (!_PyArg_NoStackKeywords("decimal", kwnames)) { + goto exit; + } return_value = unicodedata_UCD_decimal_impl(self, chr, default_value); exit: @@ -47,22 +51,26 @@ PyDoc_STRVAR(unicodedata_UCD_digit__doc__, "ValueError is raised."); #define UNICODEDATA_UCD_DIGIT_METHODDEF \ - {"digit", (PyCFunction)unicodedata_UCD_digit, METH_VARARGS, unicodedata_UCD_digit__doc__}, + {"digit", (PyCFunction)unicodedata_UCD_digit, METH_FASTCALL, unicodedata_UCD_digit__doc__}, static PyObject * unicodedata_UCD_digit_impl(PyObject *self, int chr, PyObject *default_value); static PyObject * -unicodedata_UCD_digit(PyObject *self, PyObject *args) +unicodedata_UCD_digit(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int chr; PyObject *default_value = NULL; - if (!PyArg_ParseTuple(args, "C|O:digit", + if (!_PyArg_ParseStack(args, nargs, "C|O:digit", &chr, &default_value)) { goto exit; } + + if (!_PyArg_NoStackKeywords("digit", kwnames)) { + goto exit; + } return_value = unicodedata_UCD_digit_impl(self, chr, default_value); exit: @@ -80,23 +88,27 @@ PyDoc_STRVAR(unicodedata_UCD_numeric__doc__, "ValueError is raised."); #define UNICODEDATA_UCD_NUMERIC_METHODDEF \ - {"numeric", (PyCFunction)unicodedata_UCD_numeric, METH_VARARGS, unicodedata_UCD_numeric__doc__}, + {"numeric", (PyCFunction)unicodedata_UCD_numeric, METH_FASTCALL, unicodedata_UCD_numeric__doc__}, static PyObject * unicodedata_UCD_numeric_impl(PyObject *self, int chr, PyObject *default_value); static PyObject * -unicodedata_UCD_numeric(PyObject *self, PyObject *args) +unicodedata_UCD_numeric(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int chr; PyObject *default_value = NULL; - if (!PyArg_ParseTuple(args, "C|O:numeric", + if (!_PyArg_ParseStack(args, nargs, "C|O:numeric", &chr, &default_value)) { goto exit; } + + if (!_PyArg_NoStackKeywords("numeric", kwnames)) { + goto exit; + } return_value = unicodedata_UCD_numeric_impl(self, chr, default_value); exit: @@ -293,23 +305,27 @@ PyDoc_STRVAR(unicodedata_UCD_normalize__doc__, "Valid values for form are \'NFC\', \'NFKC\', \'NFD\', and \'NFKD\'."); #define UNICODEDATA_UCD_NORMALIZE_METHODDEF \ - {"normalize", (PyCFunction)unicodedata_UCD_normalize, METH_VARARGS, unicodedata_UCD_normalize__doc__}, + {"normalize", (PyCFunction)unicodedata_UCD_normalize, METH_FASTCALL, unicodedata_UCD_normalize__doc__}, static PyObject * unicodedata_UCD_normalize_impl(PyObject *self, const char *form, PyObject *input); static PyObject * -unicodedata_UCD_normalize(PyObject *self, PyObject *args) +unicodedata_UCD_normalize(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; const char *form; PyObject *input; - if (!PyArg_ParseTuple(args, "sU:normalize", + if (!_PyArg_ParseStack(args, nargs, "sU:normalize", &form, &input)) { goto exit; } + + if (!_PyArg_NoStackKeywords("normalize", kwnames)) { + goto exit; + } return_value = unicodedata_UCD_normalize_impl(self, form, input); exit: @@ -326,22 +342,26 @@ PyDoc_STRVAR(unicodedata_UCD_name__doc__, "ValueError is raised."); #define UNICODEDATA_UCD_NAME_METHODDEF \ - {"name", (PyCFunction)unicodedata_UCD_name, METH_VARARGS, unicodedata_UCD_name__doc__}, + {"name", (PyCFunction)unicodedata_UCD_name, METH_FASTCALL, unicodedata_UCD_name__doc__}, static PyObject * unicodedata_UCD_name_impl(PyObject *self, int chr, PyObject *default_value); static PyObject * -unicodedata_UCD_name(PyObject *self, PyObject *args) +unicodedata_UCD_name(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int chr; PyObject *default_value = NULL; - if (!PyArg_ParseTuple(args, "C|O:name", + if (!_PyArg_ParseStack(args, nargs, "C|O:name", &chr, &default_value)) { goto exit; } + + if (!_PyArg_NoStackKeywords("name", kwnames)) { + goto exit; + } return_value = unicodedata_UCD_name_impl(self, chr, default_value); exit: @@ -379,4 +399,4 @@ unicodedata_UCD_lookup(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=07e93c267323a576 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fcb86aaa3fa40876 input=a9049054013a1b77]*/ |