diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-04-23 21:40:51 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-04-23 21:40:51 (GMT) |
commit | 247789cee99c8933c140110791d136cbe37a003b (patch) | |
tree | b29885b10378b1b31f51609bf719bd4f6c7de306 /Modules/_io/clinic | |
parent | a30e2256f70bd43255e8dae6459c70540f118b62 (diff) | |
download | cpython-247789cee99c8933c140110791d136cbe37a003b.zip cpython-247789cee99c8933c140110791d136cbe37a003b.tar.gz cpython-247789cee99c8933c140110791d136cbe37a003b.tar.bz2 |
Issue #24007: Argument Clinic now writes the format of PyArg_Parse*() at the
same line as function name.
Diffstat (limited to 'Modules/_io/clinic')
-rw-r--r-- | Modules/_io/clinic/_iomodule.c.h | 5 | ||||
-rw-r--r-- | Modules/_io/clinic/bufferedio.c.h | 50 | ||||
-rw-r--r-- | Modules/_io/clinic/bytesio.c.h | 12 | ||||
-rw-r--r-- | Modules/_io/clinic/fileio.c.h | 19 | ||||
-rw-r--r-- | Modules/_io/clinic/iobase.c.h | 11 | ||||
-rw-r--r-- | Modules/_io/clinic/stringio.c.h | 8 | ||||
-rw-r--r-- | Modules/_io/clinic/textio.c.h | 24 |
7 files changed, 42 insertions, 87 deletions
diff --git a/Modules/_io/clinic/_iomodule.c.h b/Modules/_io/clinic/_iomodule.c.h index df877a5..a3abb93 100644 --- a/Modules/_io/clinic/_iomodule.c.h +++ b/Modules/_io/clinic/_iomodule.c.h @@ -148,8 +148,7 @@ _io_open(PyModuleDef *module, PyObject *args, PyObject *kwargs) int closefd = 1; PyObject *opener = Py_None; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "O|sizzziO:open", _keywords, + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|sizzziO:open", _keywords, &file, &mode, &buffering, &encoding, &errors, &newline, &closefd, &opener)) goto exit; return_value = _io_open_impl(module, file, mode, buffering, encoding, errors, newline, closefd, opener); @@ -157,4 +156,4 @@ _io_open(PyModuleDef *module, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=c51a5a443c11f02b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=97cdc09bf68a8064 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/bufferedio.c.h b/Modules/_io/clinic/bufferedio.c.h index b79b8d5..437e275 100644 --- a/Modules/_io/clinic/bufferedio.c.h +++ b/Modules/_io/clinic/bufferedio.c.h @@ -19,9 +19,7 @@ _io__BufferedIOBase_readinto(PyObject *self, PyObject *arg) PyObject *return_value = NULL; Py_buffer buffer = {NULL, NULL}; - if (!PyArg_Parse(arg, - "w*:readinto", - &buffer)) + if (!PyArg_Parse(arg, "w*:readinto", &buffer)) goto exit; return_value = _io__BufferedIOBase_readinto_impl(self, &buffer); @@ -50,9 +48,7 @@ _io__BufferedIOBase_readinto1(PyObject *self, PyObject *arg) PyObject *return_value = NULL; Py_buffer buffer = {NULL, NULL}; - if (!PyArg_Parse(arg, - "w*:readinto1", - &buffer)) + if (!PyArg_Parse(arg, "w*:readinto1", &buffer)) goto exit; return_value = _io__BufferedIOBase_readinto1_impl(self, &buffer); @@ -102,8 +98,7 @@ _io__Buffered_peek(buffered *self, PyObject *args) PyObject *return_value = NULL; Py_ssize_t size = 0; - if (!PyArg_ParseTuple(args, - "|n:peek", + if (!PyArg_ParseTuple(args, "|n:peek", &size)) goto exit; return_value = _io__Buffered_peek_impl(self, size); @@ -129,8 +124,7 @@ _io__Buffered_read(buffered *self, PyObject *args) PyObject *return_value = NULL; Py_ssize_t n = -1; - if (!PyArg_ParseTuple(args, - "|O&:read", + if (!PyArg_ParseTuple(args, "|O&:read", _PyIO_ConvertSsize_t, &n)) goto exit; return_value = _io__Buffered_read_impl(self, n); @@ -156,9 +150,7 @@ _io__Buffered_read1(buffered *self, PyObject *arg) PyObject *return_value = NULL; Py_ssize_t n; - if (!PyArg_Parse(arg, - "n:read1", - &n)) + if (!PyArg_Parse(arg, "n:read1", &n)) goto exit; return_value = _io__Buffered_read1_impl(self, n); @@ -183,9 +175,7 @@ _io__Buffered_readinto(buffered *self, PyObject *arg) PyObject *return_value = NULL; Py_buffer buffer = {NULL, NULL}; - if (!PyArg_Parse(arg, - "w*:readinto", - &buffer)) + if (!PyArg_Parse(arg, "w*:readinto", &buffer)) goto exit; return_value = _io__Buffered_readinto_impl(self, &buffer); @@ -214,9 +204,7 @@ _io__Buffered_readinto1(buffered *self, PyObject *arg) PyObject *return_value = NULL; Py_buffer buffer = {NULL, NULL}; - if (!PyArg_Parse(arg, - "w*:readinto1", - &buffer)) + if (!PyArg_Parse(arg, "w*:readinto1", &buffer)) goto exit; return_value = _io__Buffered_readinto1_impl(self, &buffer); @@ -245,8 +233,7 @@ _io__Buffered_readline(buffered *self, PyObject *args) PyObject *return_value = NULL; Py_ssize_t size = -1; - if (!PyArg_ParseTuple(args, - "|O&:readline", + if (!PyArg_ParseTuple(args, "|O&:readline", _PyIO_ConvertSsize_t, &size)) goto exit; return_value = _io__Buffered_readline_impl(self, size); @@ -273,8 +260,7 @@ _io__Buffered_seek(buffered *self, PyObject *args) PyObject *targetobj; int whence = 0; - if (!PyArg_ParseTuple(args, - "O|i:seek", + if (!PyArg_ParseTuple(args, "O|i:seek", &targetobj, &whence)) goto exit; return_value = _io__Buffered_seek_impl(self, targetobj, whence); @@ -328,8 +314,7 @@ _io_BufferedReader___init__(PyObject *self, PyObject *args, PyObject *kwargs) PyObject *raw; Py_ssize_t buffer_size = DEFAULT_BUFFER_SIZE; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "O|n:BufferedReader", _keywords, + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|n:BufferedReader", _keywords, &raw, &buffer_size)) goto exit; return_value = _io_BufferedReader___init___impl((buffered *)self, raw, buffer_size); @@ -360,8 +345,7 @@ _io_BufferedWriter___init__(PyObject *self, PyObject *args, PyObject *kwargs) PyObject *raw; Py_ssize_t buffer_size = DEFAULT_BUFFER_SIZE; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "O|n:BufferedWriter", _keywords, + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|n:BufferedWriter", _keywords, &raw, &buffer_size)) goto exit; return_value = _io_BufferedWriter___init___impl((buffered *)self, raw, buffer_size); @@ -387,9 +371,7 @@ _io_BufferedWriter_write(buffered *self, PyObject *arg) PyObject *return_value = NULL; Py_buffer buffer = {NULL, NULL}; - if (!PyArg_Parse(arg, - "y*:write", - &buffer)) + if (!PyArg_Parse(arg, "y*:write", &buffer)) goto exit; return_value = _io_BufferedWriter_write_impl(self, &buffer); @@ -430,8 +412,7 @@ _io_BufferedRWPair___init__(PyObject *self, PyObject *args, PyObject *kwargs) if ((Py_TYPE(self) == &PyBufferedRWPair_Type) && !_PyArg_NoKeywords("BufferedRWPair", kwargs)) goto exit; - if (!PyArg_ParseTuple(args, - "OO|n:BufferedRWPair", + if (!PyArg_ParseTuple(args, "OO|n:BufferedRWPair", &reader, &writer, &buffer_size)) goto exit; return_value = _io_BufferedRWPair___init___impl((rwpair *)self, reader, writer, buffer_size); @@ -462,8 +443,7 @@ _io_BufferedRandom___init__(PyObject *self, PyObject *args, PyObject *kwargs) PyObject *raw; Py_ssize_t buffer_size = DEFAULT_BUFFER_SIZE; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "O|n:BufferedRandom", _keywords, + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|n:BufferedRandom", _keywords, &raw, &buffer_size)) goto exit; return_value = _io_BufferedRandom___init___impl((buffered *)self, raw, buffer_size); @@ -471,4 +451,4 @@ _io_BufferedRandom___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=78808e39f36e3fa9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=2bbb5e239b4ffe6f input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/bytesio.c.h b/Modules/_io/clinic/bytesio.c.h index 695c46a..1ab1d65 100644 --- a/Modules/_io/clinic/bytesio.c.h +++ b/Modules/_io/clinic/bytesio.c.h @@ -276,9 +276,7 @@ _io_BytesIO_readinto(bytesio *self, PyObject *arg) PyObject *return_value = NULL; Py_buffer buffer = {NULL, NULL}; - if (!PyArg_Parse(arg, - "w*:readinto", - &buffer)) + if (!PyArg_Parse(arg, "w*:readinto", &buffer)) goto exit; return_value = _io_BytesIO_readinto_impl(self, &buffer); @@ -346,8 +344,7 @@ _io_BytesIO_seek(bytesio *self, PyObject *args) Py_ssize_t pos; int whence = 0; - if (!PyArg_ParseTuple(args, - "n|i:seek", + if (!PyArg_ParseTuple(args, "n|i:seek", &pos, &whence)) goto exit; return_value = _io_BytesIO_seek_impl(self, pos, whence); @@ -414,8 +411,7 @@ _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) static char *_keywords[] = {"initial_bytes", NULL}; PyObject *initvalue = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "|O:BytesIO", _keywords, + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O:BytesIO", _keywords, &initvalue)) goto exit; return_value = _io_BytesIO___init___impl((bytesio *)self, initvalue); @@ -423,4 +419,4 @@ _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=e22697ada514f4eb input=a9049054013a1b77]*/ +/*[clinic end generated code: output=500ccc149587fac4 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/fileio.c.h b/Modules/_io/clinic/fileio.c.h index bb68cc9..4a1205e 100644 --- a/Modules/_io/clinic/fileio.c.h +++ b/Modules/_io/clinic/fileio.c.h @@ -55,8 +55,7 @@ _io_FileIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) int closefd = 1; PyObject *opener = Py_None; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "O|siO:FileIO", _keywords, + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|siO:FileIO", _keywords, &nameobj, &mode, &closefd, &opener)) goto exit; return_value = _io_FileIO___init___impl((fileio *)self, nameobj, mode, closefd, opener); @@ -155,9 +154,7 @@ _io_FileIO_readinto(fileio *self, PyObject *arg) PyObject *return_value = NULL; Py_buffer buffer = {NULL, NULL}; - if (!PyArg_Parse(arg, - "w*:readinto", - &buffer)) + if (!PyArg_Parse(arg, "w*:readinto", &buffer)) goto exit; return_value = _io_FileIO_readinto_impl(self, &buffer); @@ -212,8 +209,7 @@ _io_FileIO_read(fileio *self, PyObject *args) PyObject *return_value = NULL; Py_ssize_t size = -1; - if (!PyArg_ParseTuple(args, - "|O&:read", + if (!PyArg_ParseTuple(args, "|O&:read", _PyIO_ConvertSsize_t, &size)) goto exit; return_value = _io_FileIO_read_impl(self, size); @@ -244,9 +240,7 @@ _io_FileIO_write(fileio *self, PyObject *arg) PyObject *return_value = NULL; Py_buffer b = {NULL, NULL}; - if (!PyArg_Parse(arg, - "y*:write", - &b)) + if (!PyArg_Parse(arg, "y*:write", &b)) goto exit; return_value = _io_FileIO_write_impl(self, &b); @@ -285,8 +279,7 @@ _io_FileIO_seek(fileio *self, PyObject *args) PyObject *pos; int whence = 0; - if (!PyArg_ParseTuple(args, - "O|i:seek", + if (!PyArg_ParseTuple(args, "O|i:seek", &pos, &whence)) goto exit; return_value = _io_FileIO_seek_impl(self, pos, whence); @@ -371,4 +364,4 @@ _io_FileIO_isatty(fileio *self, PyObject *Py_UNUSED(ignored)) #ifndef _IO_FILEIO_TRUNCATE_METHODDEF #define _IO_FILEIO_TRUNCATE_METHODDEF #endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */ -/*[clinic end generated code: output=c6708e1980f6e02d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b1a20b10c81add64 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/iobase.c.h b/Modules/_io/clinic/iobase.c.h index ce47faa..3cea079 100644 --- a/Modules/_io/clinic/iobase.c.h +++ b/Modules/_io/clinic/iobase.c.h @@ -185,8 +185,7 @@ _io__IOBase_readline(PyObject *self, PyObject *args) PyObject *return_value = NULL; Py_ssize_t limit = -1; - if (!PyArg_ParseTuple(args, - "|O&:readline", + if (!PyArg_ParseTuple(args, "|O&:readline", _PyIO_ConvertSsize_t, &limit)) goto exit; return_value = _io__IOBase_readline_impl(self, limit); @@ -217,8 +216,7 @@ _io__IOBase_readlines(PyObject *self, PyObject *args) PyObject *return_value = NULL; Py_ssize_t hint = -1; - if (!PyArg_ParseTuple(args, - "|O&:readlines", + if (!PyArg_ParseTuple(args, "|O&:readlines", _PyIO_ConvertSsize_t, &hint)) goto exit; return_value = _io__IOBase_readlines_impl(self, hint); @@ -252,8 +250,7 @@ _io__RawIOBase_read(PyObject *self, PyObject *args) PyObject *return_value = NULL; Py_ssize_t n = -1; - if (!PyArg_ParseTuple(args, - "|n:read", + if (!PyArg_ParseTuple(args, "|n:read", &n)) goto exit; return_value = _io__RawIOBase_read_impl(self, n); @@ -279,4 +276,4 @@ _io__RawIOBase_readall(PyObject *self, PyObject *Py_UNUSED(ignored)) { return _io__RawIOBase_readall_impl(self); } -/*[clinic end generated code: output=84eef4b7541f54b7 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fe034152b6884e65 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/stringio.c.h b/Modules/_io/clinic/stringio.c.h index b830c6d..a8e32a3 100644 --- a/Modules/_io/clinic/stringio.c.h +++ b/Modules/_io/clinic/stringio.c.h @@ -156,8 +156,7 @@ _io_StringIO_seek(stringio *self, PyObject *args) Py_ssize_t pos; int whence = 0; - if (!PyArg_ParseTuple(args, - "n|i:seek", + if (!PyArg_ParseTuple(args, "n|i:seek", &pos, &whence)) goto exit; return_value = _io_StringIO_seek_impl(self, pos, whence); @@ -222,8 +221,7 @@ _io_StringIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) PyObject *value = NULL; PyObject *newline_obj = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "|OO:StringIO", _keywords, + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:StringIO", _keywords, &value, &newline_obj)) goto exit; return_value = _io_StringIO___init___impl((stringio *)self, value, newline_obj); @@ -285,4 +283,4 @@ _io_StringIO_seekable(stringio *self, PyObject *Py_UNUSED(ignored)) { return _io_StringIO_seekable_impl(self); } -/*[clinic end generated code: output=f3062096d357c652 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f061cf3a20cd14ed input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/textio.c.h b/Modules/_io/clinic/textio.c.h index 62603bd..dc7e8c7 100644 --- a/Modules/_io/clinic/textio.c.h +++ b/Modules/_io/clinic/textio.c.h @@ -29,8 +29,7 @@ _io_IncrementalNewlineDecoder___init__(PyObject *self, PyObject *args, PyObject int translate; PyObject *errors = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "Oi|O:IncrementalNewlineDecoder", _keywords, + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Oi|O:IncrementalNewlineDecoder", _keywords, &decoder, &translate, &errors)) goto exit; return_value = _io_IncrementalNewlineDecoder___init___impl((nldecoder_object *)self, decoder, translate, errors); @@ -59,8 +58,7 @@ _io_IncrementalNewlineDecoder_decode(nldecoder_object *self, PyObject *args, PyO PyObject *input; int final = 0; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "O|i:decode", _keywords, + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|i:decode", _keywords, &input, &final)) goto exit; return_value = _io_IncrementalNewlineDecoder_decode_impl(self, input, final); @@ -163,8 +161,7 @@ _io_TextIOWrapper___init__(PyObject *self, PyObject *args, PyObject *kwargs) int line_buffering = 0; int write_through = 0; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "O|zzzii:TextIOWrapper", _keywords, + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|zzzii:TextIOWrapper", _keywords, &buffer, &encoding, &errors, &newline, &line_buffering, &write_through)) goto exit; return_value = _io_TextIOWrapper___init___impl((textio *)self, buffer, encoding, errors, newline, line_buffering, write_through); @@ -207,9 +204,7 @@ _io_TextIOWrapper_write(textio *self, PyObject *arg) PyObject *return_value = NULL; PyObject *text; - if (!PyArg_Parse(arg, - "U:write", - &text)) + if (!PyArg_Parse(arg, "U:write", &text)) goto exit; return_value = _io_TextIOWrapper_write_impl(self, text); @@ -234,8 +229,7 @@ _io_TextIOWrapper_read(textio *self, PyObject *args) PyObject *return_value = NULL; Py_ssize_t n = -1; - if (!PyArg_ParseTuple(args, - "|O&:read", + if (!PyArg_ParseTuple(args, "|O&:read", _PyIO_ConvertSsize_t, &n)) goto exit; return_value = _io_TextIOWrapper_read_impl(self, n); @@ -261,8 +255,7 @@ _io_TextIOWrapper_readline(textio *self, PyObject *args) PyObject *return_value = NULL; Py_ssize_t size = -1; - if (!PyArg_ParseTuple(args, - "|n:readline", + if (!PyArg_ParseTuple(args, "|n:readline", &size)) goto exit; return_value = _io_TextIOWrapper_readline_impl(self, size); @@ -289,8 +282,7 @@ _io_TextIOWrapper_seek(textio *self, PyObject *args) PyObject *cookieObj; int whence = 0; - if (!PyArg_ParseTuple(args, - "O|i:seek", + if (!PyArg_ParseTuple(args, "O|i:seek", &cookieObj, &whence)) goto exit; return_value = _io_TextIOWrapper_seek_impl(self, cookieObj, whence); @@ -461,4 +453,4 @@ _io_TextIOWrapper_close(textio *self, PyObject *Py_UNUSED(ignored)) { return _io_TextIOWrapper_close_impl(self); } -/*[clinic end generated code: output=a610bd3b694886c3 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=690608f85aab8ba5 input=a9049054013a1b77]*/ |