summaryrefslogtreecommitdiff
path: root/Objects/clinic/bytesobject.c.h
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/clinic/bytesobject.c.h')
-rw-r--r--Objects/clinic/bytesobject.c.h62
1 files changed, 41 insertions, 21 deletions
diff --git a/Objects/clinic/bytesobject.c.h b/Objects/clinic/bytesobject.c.h
index a11ebd2774..c73b56023d 100644
--- a/Objects/clinic/bytesobject.c.h
+++ b/Objects/clinic/bytesobject.c.h
@@ -31,7 +31,7 @@ bytes_split(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kw
PyObject *sep = Py_None;
Py_ssize_t maxsplit = -1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&sep, &maxsplit)) {
goto exit;
}
@@ -150,7 +150,7 @@ bytes_rsplit(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *k
PyObject *sep = Py_None;
Py_ssize_t maxsplit = -1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&sep, &maxsplit)) {
goto exit;
}
@@ -184,22 +184,26 @@ PyDoc_STRVAR(bytes_strip__doc__,
"If the argument is omitted or None, strip leading and trailing ASCII whitespace.");
#define BYTES_STRIP_METHODDEF \
- {"strip", (PyCFunction)bytes_strip, METH_VARARGS, bytes_strip__doc__},
+ {"strip", (PyCFunction)bytes_strip, METH_FASTCALL, bytes_strip__doc__},
static PyObject *
bytes_strip_impl(PyBytesObject *self, PyObject *bytes);
static PyObject *
-bytes_strip(PyBytesObject *self, PyObject *args)
+bytes_strip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *bytes = Py_None;
- if (!PyArg_UnpackTuple(args, "strip",
+ if (!_PyArg_UnpackStack(args, nargs, "strip",
0, 1,
&bytes)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("strip", kwnames)) {
+ goto exit;
+ }
return_value = bytes_strip_impl(self, bytes);
exit:
@@ -215,22 +219,26 @@ PyDoc_STRVAR(bytes_lstrip__doc__,
"If the argument is omitted or None, strip leading ASCII whitespace.");
#define BYTES_LSTRIP_METHODDEF \
- {"lstrip", (PyCFunction)bytes_lstrip, METH_VARARGS, bytes_lstrip__doc__},
+ {"lstrip", (PyCFunction)bytes_lstrip, METH_FASTCALL, bytes_lstrip__doc__},
static PyObject *
bytes_lstrip_impl(PyBytesObject *self, PyObject *bytes);
static PyObject *
-bytes_lstrip(PyBytesObject *self, PyObject *args)
+bytes_lstrip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *bytes = Py_None;
- if (!PyArg_UnpackTuple(args, "lstrip",
+ if (!_PyArg_UnpackStack(args, nargs, "lstrip",
0, 1,
&bytes)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("lstrip", kwnames)) {
+ goto exit;
+ }
return_value = bytes_lstrip_impl(self, bytes);
exit:
@@ -246,22 +254,26 @@ PyDoc_STRVAR(bytes_rstrip__doc__,
"If the argument is omitted or None, strip trailing ASCII whitespace.");
#define BYTES_RSTRIP_METHODDEF \
- {"rstrip", (PyCFunction)bytes_rstrip, METH_VARARGS, bytes_rstrip__doc__},
+ {"rstrip", (PyCFunction)bytes_rstrip, METH_FASTCALL, bytes_rstrip__doc__},
static PyObject *
bytes_rstrip_impl(PyBytesObject *self, PyObject *bytes);
static PyObject *
-bytes_rstrip(PyBytesObject *self, PyObject *args)
+bytes_rstrip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *bytes = Py_None;
- if (!PyArg_UnpackTuple(args, "rstrip",
+ if (!_PyArg_UnpackStack(args, nargs, "rstrip",
0, 1,
&bytes)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("rstrip", kwnames)) {
+ goto exit;
+ }
return_value = bytes_rstrip_impl(self, bytes);
exit:
@@ -296,7 +308,7 @@ bytes_translate(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject
PyObject *table;
PyObject *deletechars = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&table, &deletechars)) {
goto exit;
}
@@ -318,22 +330,26 @@ PyDoc_STRVAR(bytes_maketrans__doc__,
"The bytes objects frm and to must be of the same length.");
#define BYTES_MAKETRANS_METHODDEF \
- {"maketrans", (PyCFunction)bytes_maketrans, METH_VARARGS|METH_STATIC, bytes_maketrans__doc__},
+ {"maketrans", (PyCFunction)bytes_maketrans, METH_FASTCALL|METH_STATIC, bytes_maketrans__doc__},
static PyObject *
bytes_maketrans_impl(Py_buffer *frm, Py_buffer *to);
static PyObject *
-bytes_maketrans(void *null, PyObject *args)
+bytes_maketrans(void *null, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer frm = {NULL, NULL};
Py_buffer to = {NULL, NULL};
- if (!PyArg_ParseTuple(args, "y*y*:maketrans",
+ if (!_PyArg_ParseStack(args, nargs, "y*y*:maketrans",
&frm, &to)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("maketrans", kwnames)) {
+ goto exit;
+ }
return_value = bytes_maketrans_impl(&frm, &to);
exit:
@@ -363,24 +379,28 @@ PyDoc_STRVAR(bytes_replace__doc__,
"replaced.");
#define BYTES_REPLACE_METHODDEF \
- {"replace", (PyCFunction)bytes_replace, METH_VARARGS, bytes_replace__doc__},
+ {"replace", (PyCFunction)bytes_replace, METH_FASTCALL, bytes_replace__doc__},
static PyObject *
bytes_replace_impl(PyBytesObject *self, Py_buffer *old, Py_buffer *new,
Py_ssize_t count);
static PyObject *
-bytes_replace(PyBytesObject *self, PyObject *args)
+bytes_replace(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer old = {NULL, NULL};
Py_buffer new = {NULL, NULL};
Py_ssize_t count = -1;
- if (!PyArg_ParseTuple(args, "y*y*|n:replace",
+ if (!_PyArg_ParseStack(args, nargs, "y*y*|n:replace",
&old, &new, &count)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("replace", kwnames)) {
+ goto exit;
+ }
return_value = bytes_replace_impl(self, &old, &new, count);
exit:
@@ -427,7 +447,7 @@ bytes_decode(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *k
const char *encoding = NULL;
const char *errors = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&encoding, &errors)) {
goto exit;
}
@@ -460,7 +480,7 @@ bytes_splitlines(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObjec
static _PyArg_Parser _parser = {"|i:splitlines", _keywords, 0};
int keepends = 0;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&keepends)) {
goto exit;
}
@@ -499,4 +519,4 @@ bytes_fromhex(PyTypeObject *type, PyObject *arg)
exit:
return return_value;
}
-/*[clinic end generated code: output=2dc3c93cfd2dc440 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=2504c1225108d348 input=a9049054013a1b77]*/