diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-07-03 18:20:15 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-03 18:20:15 (GMT) |
commit | 6969eaf4682beb01bc95eeb14f5ce6c01312e297 (patch) | |
tree | c81a3d9bca3e9d01f557c46a8534a4e3873403f9 /Objects/clinic/bytesobject.c.h | |
parent | aa0aa0492c5fffe750a26d2ab13737a1a6d7d63c (diff) | |
download | cpython-6969eaf4682beb01bc95eeb14f5ce6c01312e297.zip cpython-6969eaf4682beb01bc95eeb14f5ce6c01312e297.tar.gz cpython-6969eaf4682beb01bc95eeb14f5ce6c01312e297.tar.bz2 |
bpo-29464: Rename METH_FASTCALL to METH_FASTCALL|METH_KEYWORDS and make (#1955)
the bare METH_FASTCALL be used for functions with positional-only
parameters.
Diffstat (limited to 'Objects/clinic/bytesobject.c.h')
-rw-r--r-- | Objects/clinic/bytesobject.c.h | 42 |
1 files changed, 11 insertions, 31 deletions
diff --git a/Objects/clinic/bytesobject.c.h b/Objects/clinic/bytesobject.c.h index da17cf8..315f6f2 100644 --- a/Objects/clinic/bytesobject.c.h +++ b/Objects/clinic/bytesobject.c.h @@ -17,7 +17,7 @@ PyDoc_STRVAR(bytes_split__doc__, " -1 (the default value) means no limit."); #define BYTES_SPLIT_METHODDEF \ - {"split", (PyCFunction)bytes_split, METH_FASTCALL, bytes_split__doc__}, + {"split", (PyCFunction)bytes_split, METH_FASTCALL|METH_KEYWORDS, bytes_split__doc__}, static PyObject * bytes_split_impl(PyBytesObject *self, PyObject *sep, Py_ssize_t maxsplit); @@ -136,7 +136,7 @@ PyDoc_STRVAR(bytes_rsplit__doc__, "Splitting is done starting at the end of the bytes and working to the front."); #define BYTES_RSPLIT_METHODDEF \ - {"rsplit", (PyCFunction)bytes_rsplit, METH_FASTCALL, bytes_rsplit__doc__}, + {"rsplit", (PyCFunction)bytes_rsplit, METH_FASTCALL|METH_KEYWORDS, bytes_rsplit__doc__}, static PyObject * bytes_rsplit_impl(PyBytesObject *self, PyObject *sep, Py_ssize_t maxsplit); @@ -190,15 +190,11 @@ static PyObject * bytes_strip_impl(PyBytesObject *self, PyObject *bytes); static PyObject * -bytes_strip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) +bytes_strip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs) { PyObject *return_value = NULL; PyObject *bytes = Py_None; - if (!_PyArg_NoStackKeywords("strip", kwnames)) { - goto exit; - } - if (!_PyArg_UnpackStack(args, nargs, "strip", 0, 1, &bytes)) { @@ -225,15 +221,11 @@ static PyObject * bytes_lstrip_impl(PyBytesObject *self, PyObject *bytes); static PyObject * -bytes_lstrip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) +bytes_lstrip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs) { PyObject *return_value = NULL; PyObject *bytes = Py_None; - if (!_PyArg_NoStackKeywords("lstrip", kwnames)) { - goto exit; - } - if (!_PyArg_UnpackStack(args, nargs, "lstrip", 0, 1, &bytes)) { @@ -260,15 +252,11 @@ static PyObject * bytes_rstrip_impl(PyBytesObject *self, PyObject *bytes); static PyObject * -bytes_rstrip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) +bytes_rstrip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs) { PyObject *return_value = NULL; PyObject *bytes = Py_None; - if (!_PyArg_NoStackKeywords("rstrip", kwnames)) { - goto exit; - } - if (!_PyArg_UnpackStack(args, nargs, "rstrip", 0, 1, &bytes)) { @@ -293,7 +281,7 @@ PyDoc_STRVAR(bytes_translate__doc__, "The remaining characters are mapped through the given translation table."); #define BYTES_TRANSLATE_METHODDEF \ - {"translate", (PyCFunction)bytes_translate, METH_FASTCALL, bytes_translate__doc__}, + {"translate", (PyCFunction)bytes_translate, METH_FASTCALL|METH_KEYWORDS, bytes_translate__doc__}, static PyObject * bytes_translate_impl(PyBytesObject *self, PyObject *table, @@ -336,16 +324,12 @@ static PyObject * bytes_maketrans_impl(Py_buffer *frm, Py_buffer *to); static PyObject * -bytes_maketrans(void *null, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) +bytes_maketrans(void *null, PyObject **args, Py_ssize_t nargs) { PyObject *return_value = NULL; Py_buffer frm = {NULL, NULL}; Py_buffer to = {NULL, NULL}; - if (!_PyArg_NoStackKeywords("maketrans", kwnames)) { - goto exit; - } - if (!_PyArg_ParseStack(args, nargs, "y*y*:maketrans", &frm, &to)) { goto exit; @@ -386,17 +370,13 @@ bytes_replace_impl(PyBytesObject *self, Py_buffer *old, Py_buffer *new, Py_ssize_t count); static PyObject * -bytes_replace(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) +bytes_replace(PyBytesObject *self, PyObject **args, Py_ssize_t nargs) { PyObject *return_value = NULL; Py_buffer old = {NULL, NULL}; Py_buffer new = {NULL, NULL}; Py_ssize_t count = -1; - if (!_PyArg_NoStackKeywords("replace", kwnames)) { - goto exit; - } - if (!_PyArg_ParseStack(args, nargs, "y*y*|n:replace", &old, &new, &count)) { goto exit; @@ -432,7 +412,7 @@ PyDoc_STRVAR(bytes_decode__doc__, " can handle UnicodeDecodeErrors."); #define BYTES_DECODE_METHODDEF \ - {"decode", (PyCFunction)bytes_decode, METH_FASTCALL, bytes_decode__doc__}, + {"decode", (PyCFunction)bytes_decode, METH_FASTCALL|METH_KEYWORDS, bytes_decode__doc__}, static PyObject * bytes_decode_impl(PyBytesObject *self, const char *encoding, @@ -467,7 +447,7 @@ PyDoc_STRVAR(bytes_splitlines__doc__, "true."); #define BYTES_SPLITLINES_METHODDEF \ - {"splitlines", (PyCFunction)bytes_splitlines, METH_FASTCALL, bytes_splitlines__doc__}, + {"splitlines", (PyCFunction)bytes_splitlines, METH_FASTCALL|METH_KEYWORDS, bytes_splitlines__doc__}, static PyObject * bytes_splitlines_impl(PyBytesObject *self, int keepends); @@ -519,4 +499,4 @@ bytes_fromhex(PyTypeObject *type, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=a82999760469bbec input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9e3374bd7d04c163 input=a9049054013a1b77]*/ |