summaryrefslogtreecommitdiff
path: root/Objects/clinic
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-04-24 00:40:51 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2015-04-24 00:40:51 +0300
commit247789cee99c8933c140110791d136cbe37a003b (patch)
treeb29885b10378b1b31f51609bf719bd4f6c7de306 /Objects/clinic
parenta30e2256f70bd43255e8dae6459c70540f118b62 (diff)
downloadcpython-git-247789cee99c8933c140110791d136cbe37a003b.tar.gz
Issue #24007: Argument Clinic now writes the format of PyArg_Parse*() at the
same line as function name.
Diffstat (limited to 'Objects/clinic')
-rw-r--r--Objects/clinic/bytearrayobject.c.h41
-rw-r--r--Objects/clinic/bytesobject.c.h32
-rw-r--r--Objects/clinic/unicodeobject.c.h5
3 files changed, 25 insertions, 53 deletions
diff --git a/Objects/clinic/bytearrayobject.c.h b/Objects/clinic/bytearrayobject.c.h
index 787efc0828..e87a22127c 100644
--- a/Objects/clinic/bytearrayobject.c.h
+++ b/Objects/clinic/bytearrayobject.c.h
@@ -107,8 +107,7 @@ bytearray_maketrans(void *null, PyObject *args)
Py_buffer frm = {NULL, NULL};
Py_buffer to = {NULL, NULL};
- if (!PyArg_ParseTuple(args,
- "y*y*:maketrans",
+ if (!PyArg_ParseTuple(args, "y*y*:maketrans",
&frm, &to))
goto exit;
return_value = bytearray_maketrans_impl(&frm, &to);
@@ -152,8 +151,7 @@ bytearray_replace(PyByteArrayObject *self, PyObject *args)
Py_buffer new = {NULL, NULL};
Py_ssize_t count = -1;
- if (!PyArg_ParseTuple(args,
- "y*y*|n:replace",
+ if (!PyArg_ParseTuple(args, "y*y*|n:replace",
&old, &new, &count))
goto exit;
return_value = bytearray_replace_impl(self, &old, &new, count);
@@ -198,8 +196,7 @@ bytearray_split(PyByteArrayObject *self, PyObject *args, PyObject *kwargs)
PyObject *sep = Py_None;
Py_ssize_t maxsplit = -1;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs,
- "|On:split", _keywords,
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|On:split", _keywords,
&sep, &maxsplit))
goto exit;
return_value = bytearray_split_impl(self, sep, maxsplit);
@@ -271,8 +268,7 @@ bytearray_rsplit(PyByteArrayObject *self, PyObject *args, PyObject *kwargs)
PyObject *sep = Py_None;
Py_ssize_t maxsplit = -1;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs,
- "|On:rsplit", _keywords,
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|On:rsplit", _keywords,
&sep, &maxsplit))
goto exit;
return_value = bytearray_rsplit_impl(self, sep, maxsplit);
@@ -323,8 +319,7 @@ bytearray_insert(PyByteArrayObject *self, PyObject *args)
Py_ssize_t index;
int item;
- if (!PyArg_ParseTuple(args,
- "nO&:insert",
+ if (!PyArg_ParseTuple(args, "nO&:insert",
&index, _getbytevalue, &item))
goto exit;
return_value = bytearray_insert_impl(self, index, item);
@@ -354,9 +349,7 @@ bytearray_append(PyByteArrayObject *self, PyObject *arg)
PyObject *return_value = NULL;
int item;
- if (!PyArg_Parse(arg,
- "O&:append",
- _getbytevalue, &item))
+ if (!PyArg_Parse(arg, "O&:append", _getbytevalue, &item))
goto exit;
return_value = bytearray_append_impl(self, item);
@@ -400,8 +393,7 @@ bytearray_pop(PyByteArrayObject *self, PyObject *args)
PyObject *return_value = NULL;
Py_ssize_t index = -1;
- if (!PyArg_ParseTuple(args,
- "|n:pop",
+ if (!PyArg_ParseTuple(args, "|n:pop",
&index))
goto exit;
return_value = bytearray_pop_impl(self, index);
@@ -431,9 +423,7 @@ bytearray_remove(PyByteArrayObject *self, PyObject *arg)
PyObject *return_value = NULL;
int value;
- if (!PyArg_Parse(arg,
- "O&:remove",
- _getbytevalue, &value))
+ if (!PyArg_Parse(arg, "O&:remove", _getbytevalue, &value))
goto exit;
return_value = bytearray_remove_impl(self, value);
@@ -561,8 +551,7 @@ bytearray_decode(PyByteArrayObject *self, PyObject *args, PyObject *kwargs)
const char *encoding = NULL;
const char *errors = NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs,
- "|ss:decode", _keywords,
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|ss:decode", _keywords,
&encoding, &errors))
goto exit;
return_value = bytearray_decode_impl(self, encoding, errors);
@@ -606,8 +595,7 @@ bytearray_splitlines(PyByteArrayObject *self, PyObject *args, PyObject *kwargs)
static char *_keywords[] = {"keepends", NULL};
int keepends = 0;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs,
- "|i:splitlines", _keywords,
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:splitlines", _keywords,
&keepends))
goto exit;
return_value = bytearray_splitlines_impl(self, keepends);
@@ -637,9 +625,7 @@ bytearray_fromhex(PyTypeObject *cls, PyObject *arg)
PyObject *return_value = NULL;
PyObject *string;
- if (!PyArg_Parse(arg,
- "U:fromhex",
- &string))
+ if (!PyArg_Parse(arg, "U:fromhex", &string))
goto exit;
return_value = bytearray_fromhex_impl((PyObject*)cls, string);
@@ -683,8 +669,7 @@ bytearray_reduce_ex(PyByteArrayObject *self, PyObject *args)
PyObject *return_value = NULL;
int proto = 0;
- if (!PyArg_ParseTuple(args,
- "|i:__reduce_ex__",
+ if (!PyArg_ParseTuple(args, "|i:__reduce_ex__",
&proto))
goto exit;
return_value = bytearray_reduce_ex_impl(self, proto);
@@ -710,4 +695,4 @@ bytearray_sizeof(PyByteArrayObject *self, PyObject *Py_UNUSED(ignored))
{
return bytearray_sizeof_impl(self);
}
-/*[clinic end generated code: output=2a698741a4f14047 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=966c15ff22c5e243 input=a9049054013a1b77]*/
diff --git a/Objects/clinic/bytesobject.c.h b/Objects/clinic/bytesobject.c.h
index 770221109c..5a1a5e91a6 100644
--- a/Objects/clinic/bytesobject.c.h
+++ b/Objects/clinic/bytesobject.c.h
@@ -30,8 +30,7 @@ bytes_split(PyBytesObject*self, PyObject *args, PyObject *kwargs)
PyObject *sep = Py_None;
Py_ssize_t maxsplit = -1;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs,
- "|On:split", _keywords,
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|On:split", _keywords,
&sep, &maxsplit))
goto exit;
return_value = bytes_split_impl(self, sep, maxsplit);
@@ -65,9 +64,7 @@ bytes_partition(PyBytesObject *self, PyObject *arg)
PyObject *return_value = NULL;
Py_buffer sep = {NULL, NULL};
- if (!PyArg_Parse(arg,
- "y*:partition",
- &sep))
+ if (!PyArg_Parse(arg, "y*:partition", &sep))
goto exit;
return_value = bytes_partition_impl(self, &sep);
@@ -104,9 +101,7 @@ bytes_rpartition(PyBytesObject *self, PyObject *arg)
PyObject *return_value = NULL;
Py_buffer sep = {NULL, NULL};
- if (!PyArg_Parse(arg,
- "y*:rpartition",
- &sep))
+ if (!PyArg_Parse(arg, "y*:rpartition", &sep))
goto exit;
return_value = bytes_rpartition_impl(self, &sep);
@@ -148,8 +143,7 @@ bytes_rsplit(PyBytesObject*self, PyObject *args, PyObject *kwargs)
PyObject *sep = Py_None;
Py_ssize_t maxsplit = -1;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs,
- "|On:rsplit", _keywords,
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|On:rsplit", _keywords,
&sep, &maxsplit))
goto exit;
return_value = bytes_rsplit_impl(self, sep, maxsplit);
@@ -332,8 +326,7 @@ bytes_maketrans(void *null, PyObject *args)
Py_buffer frm = {NULL, NULL};
Py_buffer to = {NULL, NULL};
- if (!PyArg_ParseTuple(args,
- "y*y*:maketrans",
+ if (!PyArg_ParseTuple(args, "y*y*:maketrans",
&frm, &to))
goto exit;
return_value = bytes_maketrans_impl(&frm, &to);
@@ -377,8 +370,7 @@ bytes_replace(PyBytesObject*self, PyObject *args)
Py_buffer new = {NULL, NULL};
Py_ssize_t count = -1;
- if (!PyArg_ParseTuple(args,
- "y*y*|n:replace",
+ if (!PyArg_ParseTuple(args, "y*y*|n:replace",
&old, &new, &count))
goto exit;
return_value = bytes_replace_impl(self, &old, &new, count);
@@ -424,8 +416,7 @@ bytes_decode(PyBytesObject*self, PyObject *args, PyObject *kwargs)
const char *encoding = NULL;
const char *errors = NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs,
- "|ss:decode", _keywords,
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|ss:decode", _keywords,
&encoding, &errors))
goto exit;
return_value = bytes_decode_impl(self, encoding, errors);
@@ -456,8 +447,7 @@ bytes_splitlines(PyBytesObject*self, PyObject *args, PyObject *kwargs)
static char *_keywords[] = {"keepends", NULL};
int keepends = 0;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs,
- "|i:splitlines", _keywords,
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:splitlines", _keywords,
&keepends))
goto exit;
return_value = bytes_splitlines_impl(self, keepends);
@@ -487,13 +477,11 @@ bytes_fromhex(PyTypeObject *type, PyObject *arg)
PyObject *return_value = NULL;
PyObject *string;
- if (!PyArg_Parse(arg,
- "U:fromhex",
- &string))
+ if (!PyArg_Parse(arg, "U:fromhex", &string))
goto exit;
return_value = bytes_fromhex_impl(type, string);
exit:
return return_value;
}
-/*[clinic end generated code: output=deaf886e15270679 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=bd0ce8f25d7e18f4 input=a9049054013a1b77]*/
diff --git a/Objects/clinic/unicodeobject.c.h b/Objects/clinic/unicodeobject.c.h
index 053a471c73..d42a70002a 100644
--- a/Objects/clinic/unicodeobject.c.h
+++ b/Objects/clinic/unicodeobject.c.h
@@ -30,8 +30,7 @@ unicode_maketrans(void *null, PyObject *args)
PyObject *y = NULL;
PyObject *z = NULL;
- if (!PyArg_ParseTuple(args,
- "O|UU:maketrans",
+ if (!PyArg_ParseTuple(args, "O|UU:maketrans",
&x, &y, &z))
goto exit;
return_value = unicode_maketrans_impl(x, y, z);
@@ -39,4 +38,4 @@ unicode_maketrans(void *null, PyObject *args)
exit:
return return_value;
}
-/*[clinic end generated code: output=4670413843c53055 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=94affdff5b2daff5 input=a9049054013a1b77]*/