Skip to content

Commit 7ab395d

Browse files
bpo-29464: Update generated Argument Clinic code.
1 parent b3a7915 commit 7ab395d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+567
-1847
lines changed

Modules/_io/clinic/_iomodule.c.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ PyDoc_STRVAR(_io_open__doc__,
127127
"opened in a binary mode.");
128128

129129
#define _IO_OPEN_METHODDEF \
130-
{"open", (PyCFunction)_io_open, METH_FASTCALL, _io_open__doc__},
130+
{"open", (PyCFunction)_io_open, METH_FASTCALL|METH_KEYWORDS, _io_open__doc__},
131131

132132
static PyObject *
133133
_io_open_impl(PyObject *module, PyObject *file, const char *mode,
@@ -158,4 +158,4 @@ _io_open(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
158158
exit:
159159
return return_value;
160160
}
161-
/*[clinic end generated code: output=e6011c784fe6589b input=a9049054013a1b77]*/
161+
/*[clinic end generated code: output=7e0ab289d8465580 input=a9049054013a1b77]*/

Modules/_io/clinic/bufferedio.c.h

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,11 @@ static PyObject *
9797
_io__Buffered_peek_impl(buffered *self, Py_ssize_t size);
9898

9999
static PyObject *
100-
_io__Buffered_peek(buffered *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
100+
_io__Buffered_peek(buffered *self, PyObject **args, Py_ssize_t nargs)
101101
{
102102
PyObject *return_value = NULL;
103103
Py_ssize_t size = 0;
104104

105-
if (!_PyArg_NoStackKeywords("peek", kwnames)) {
106-
goto exit;
107-
}
108-
109105
if (!_PyArg_ParseStack(args, nargs, "|n:peek",
110106
&size)) {
111107
goto exit;
@@ -128,15 +124,11 @@ static PyObject *
128124
_io__Buffered_read_impl(buffered *self, Py_ssize_t n);
129125

130126
static PyObject *
131-
_io__Buffered_read(buffered *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
127+
_io__Buffered_read(buffered *self, PyObject **args, Py_ssize_t nargs)
132128
{
133129
PyObject *return_value = NULL;
134130
Py_ssize_t n = -1;
135131

136-
if (!_PyArg_NoStackKeywords("read", kwnames)) {
137-
goto exit;
138-
}
139-
140132
if (!_PyArg_ParseStack(args, nargs, "|O&:read",
141133
_Py_convert_optional_to_ssize_t, &n)) {
142134
goto exit;
@@ -159,15 +151,11 @@ static PyObject *
159151
_io__Buffered_read1_impl(buffered *self, Py_ssize_t n);
160152

161153
static PyObject *
162-
_io__Buffered_read1(buffered *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
154+
_io__Buffered_read1(buffered *self, PyObject **args, Py_ssize_t nargs)
163155
{
164156
PyObject *return_value = NULL;
165157
Py_ssize_t n = -1;
166158

167-
if (!_PyArg_NoStackKeywords("read1", kwnames)) {
168-
goto exit;
169-
}
170-
171159
if (!_PyArg_ParseStack(args, nargs, "|n:read1",
172160
&n)) {
173161
goto exit;
@@ -252,15 +240,11 @@ static PyObject *
252240
_io__Buffered_readline_impl(buffered *self, Py_ssize_t size);
253241

254242
static PyObject *
255-
_io__Buffered_readline(buffered *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
243+
_io__Buffered_readline(buffered *self, PyObject **args, Py_ssize_t nargs)
256244
{
257245
PyObject *return_value = NULL;
258246
Py_ssize_t size = -1;
259247

260-
if (!_PyArg_NoStackKeywords("readline", kwnames)) {
261-
goto exit;
262-
}
263-
264248
if (!_PyArg_ParseStack(args, nargs, "|O&:readline",
265249
_Py_convert_optional_to_ssize_t, &size)) {
266250
goto exit;
@@ -283,16 +267,12 @@ static PyObject *
283267
_io__Buffered_seek_impl(buffered *self, PyObject *targetobj, int whence);
284268

285269
static PyObject *
286-
_io__Buffered_seek(buffered *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
270+
_io__Buffered_seek(buffered *self, PyObject **args, Py_ssize_t nargs)
287271
{
288272
PyObject *return_value = NULL;
289273
PyObject *targetobj;
290274
int whence = 0;
291275

292-
if (!_PyArg_NoStackKeywords("seek", kwnames)) {
293-
goto exit;
294-
}
295-
296276
if (!_PyArg_ParseStack(args, nargs, "O|i:seek",
297277
&targetobj, &whence)) {
298278
goto exit;
@@ -315,15 +295,11 @@ static PyObject *
315295
_io__Buffered_truncate_impl(buffered *self, PyObject *pos);
316296

317297
static PyObject *
318-
_io__Buffered_truncate(buffered *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
298+
_io__Buffered_truncate(buffered *self, PyObject **args, Py_ssize_t nargs)
319299
{
320300
PyObject *return_value = NULL;
321301
PyObject *pos = Py_None;
322302

323-
if (!_PyArg_NoStackKeywords("truncate", kwnames)) {
324-
goto exit;
325-
}
326-
327303
if (!_PyArg_UnpackStack(args, nargs, "truncate",
328304
0, 1,
329305
&pos)) {
@@ -500,4 +476,4 @@ _io_BufferedRandom___init__(PyObject *self, PyObject *args, PyObject *kwargs)
500476
exit:
501477
return return_value;
502478
}
503-
/*[clinic end generated code: output=4f7490f82427c63b input=a9049054013a1b77]*/
479+
/*[clinic end generated code: output=2b817df0bf814ddc input=a9049054013a1b77]*/

Modules/_io/clinic/bytesio.c.h

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,11 @@ static PyObject *
164164
_io_BytesIO_read_impl(bytesio *self, Py_ssize_t size);
165165

166166
static PyObject *
167-
_io_BytesIO_read(bytesio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
167+
_io_BytesIO_read(bytesio *self, PyObject **args, Py_ssize_t nargs)
168168
{
169169
PyObject *return_value = NULL;
170170
Py_ssize_t size = -1;
171171

172-
if (!_PyArg_NoStackKeywords("read", kwnames)) {
173-
goto exit;
174-
}
175-
176172
if (!_PyArg_ParseStack(args, nargs, "|O&:read",
177173
_Py_convert_optional_to_ssize_t, &size)) {
178174
goto exit;
@@ -199,15 +195,11 @@ static PyObject *
199195
_io_BytesIO_read1_impl(bytesio *self, Py_ssize_t size);
200196

201197
static PyObject *
202-
_io_BytesIO_read1(bytesio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
198+
_io_BytesIO_read1(bytesio *self, PyObject **args, Py_ssize_t nargs)
203199
{
204200
PyObject *return_value = NULL;
205201
Py_ssize_t size = -1;
206202

207-
if (!_PyArg_NoStackKeywords("read1", kwnames)) {
208-
goto exit;
209-
}
210-
211203
if (!_PyArg_ParseStack(args, nargs, "|O&:read1",
212204
_Py_convert_optional_to_ssize_t, &size)) {
213205
goto exit;
@@ -235,15 +227,11 @@ static PyObject *
235227
_io_BytesIO_readline_impl(bytesio *self, Py_ssize_t size);
236228

237229
static PyObject *
238-
_io_BytesIO_readline(bytesio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
230+
_io_BytesIO_readline(bytesio *self, PyObject **args, Py_ssize_t nargs)
239231
{
240232
PyObject *return_value = NULL;
241233
Py_ssize_t size = -1;
242234

243-
if (!_PyArg_NoStackKeywords("readline", kwnames)) {
244-
goto exit;
245-
}
246-
247235
if (!_PyArg_ParseStack(args, nargs, "|O&:readline",
248236
_Py_convert_optional_to_ssize_t, &size)) {
249237
goto exit;
@@ -271,15 +259,11 @@ static PyObject *
271259
_io_BytesIO_readlines_impl(bytesio *self, PyObject *arg);
272260

273261
static PyObject *
274-
_io_BytesIO_readlines(bytesio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
262+
_io_BytesIO_readlines(bytesio *self, PyObject **args, Py_ssize_t nargs)
275263
{
276264
PyObject *return_value = NULL;
277265
PyObject *arg = Py_None;
278266

279-
if (!_PyArg_NoStackKeywords("readlines", kwnames)) {
280-
goto exit;
281-
}
282-
283267
if (!_PyArg_UnpackStack(args, nargs, "readlines",
284268
0, 1,
285269
&arg)) {
@@ -342,15 +326,11 @@ static PyObject *
342326
_io_BytesIO_truncate_impl(bytesio *self, Py_ssize_t size);
343327

344328
static PyObject *
345-
_io_BytesIO_truncate(bytesio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
329+
_io_BytesIO_truncate(bytesio *self, PyObject **args, Py_ssize_t nargs)
346330
{
347331
PyObject *return_value = NULL;
348332
Py_ssize_t size = self->pos;
349333

350-
if (!_PyArg_NoStackKeywords("truncate", kwnames)) {
351-
goto exit;
352-
}
353-
354334
if (!_PyArg_ParseStack(args, nargs, "|O&:truncate",
355335
_Py_convert_optional_to_ssize_t, &size)) {
356336
goto exit;
@@ -380,16 +360,12 @@ static PyObject *
380360
_io_BytesIO_seek_impl(bytesio *self, Py_ssize_t pos, int whence);
381361

382362
static PyObject *
383-
_io_BytesIO_seek(bytesio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
363+
_io_BytesIO_seek(bytesio *self, PyObject **args, Py_ssize_t nargs)
384364
{
385365
PyObject *return_value = NULL;
386366
Py_ssize_t pos;
387367
int whence = 0;
388368

389-
if (!_PyArg_NoStackKeywords("seek", kwnames)) {
390-
goto exit;
391-
}
392-
393369
if (!_PyArg_ParseStack(args, nargs, "n|i:seek",
394370
&pos, &whence)) {
395371
goto exit;
@@ -468,4 +444,4 @@ _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs)
468444
exit:
469445
return return_value;
470446
}
471-
/*[clinic end generated code: output=9e63715414bffb2a input=a9049054013a1b77]*/
447+
/*[clinic end generated code: output=20946f5a2ed4492b input=a9049054013a1b77]*/

Modules/_io/clinic/fileio.c.h

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -208,15 +208,11 @@ static PyObject *
208208
_io_FileIO_read_impl(fileio *self, Py_ssize_t size);
209209

210210
static PyObject *
211-
_io_FileIO_read(fileio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
211+
_io_FileIO_read(fileio *self, PyObject **args, Py_ssize_t nargs)
212212
{
213213
PyObject *return_value = NULL;
214214
Py_ssize_t size = -1;
215215

216-
if (!_PyArg_NoStackKeywords("read", kwnames)) {
217-
goto exit;
218-
}
219-
220216
if (!_PyArg_ParseStack(args, nargs, "|O&:read",
221217
_Py_convert_optional_to_ssize_t, &size)) {
222218
goto exit;
@@ -284,16 +280,12 @@ static PyObject *
284280
_io_FileIO_seek_impl(fileio *self, PyObject *pos, int whence);
285281

286282
static PyObject *
287-
_io_FileIO_seek(fileio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
283+
_io_FileIO_seek(fileio *self, PyObject **args, Py_ssize_t nargs)
288284
{
289285
PyObject *return_value = NULL;
290286
PyObject *pos;
291287
int whence = 0;
292288

293-
if (!_PyArg_NoStackKeywords("seek", kwnames)) {
294-
goto exit;
295-
}
296-
297289
if (!_PyArg_ParseStack(args, nargs, "O|i:seek",
298290
&pos, &whence)) {
299291
goto exit;
@@ -342,15 +334,11 @@ static PyObject *
342334
_io_FileIO_truncate_impl(fileio *self, PyObject *posobj);
343335

344336
static PyObject *
345-
_io_FileIO_truncate(fileio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
337+
_io_FileIO_truncate(fileio *self, PyObject **args, Py_ssize_t nargs)
346338
{
347339
PyObject *return_value = NULL;
348340
PyObject *posobj = NULL;
349341

350-
if (!_PyArg_NoStackKeywords("truncate", kwnames)) {
351-
goto exit;
352-
}
353-
354342
if (!_PyArg_UnpackStack(args, nargs, "truncate",
355343
0, 1,
356344
&posobj)) {
@@ -385,4 +373,4 @@ _io_FileIO_isatty(fileio *self, PyObject *Py_UNUSED(ignored))
385373
#ifndef _IO_FILEIO_TRUNCATE_METHODDEF
386374
#define _IO_FILEIO_TRUNCATE_METHODDEF
387375
#endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */
388-
/*[clinic end generated code: output=2c6a5470100a8f10 input=a9049054013a1b77]*/
376+
/*[clinic end generated code: output=1af8b4031633b763 input=a9049054013a1b77]*/

Modules/_io/clinic/iobase.c.h

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,11 @@ static PyObject *
180180
_io__IOBase_readline_impl(PyObject *self, Py_ssize_t limit);
181181

182182
static PyObject *
183-
_io__IOBase_readline(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
183+
_io__IOBase_readline(PyObject *self, PyObject **args, Py_ssize_t nargs)
184184
{
185185
PyObject *return_value = NULL;
186186
Py_ssize_t limit = -1;
187187

188-
if (!_PyArg_NoStackKeywords("readline", kwnames)) {
189-
goto exit;
190-
}
191-
192188
if (!_PyArg_ParseStack(args, nargs, "|O&:readline",
193189
_Py_convert_optional_to_ssize_t, &limit)) {
194190
goto exit;
@@ -216,15 +212,11 @@ static PyObject *
216212
_io__IOBase_readlines_impl(PyObject *self, Py_ssize_t hint);
217213

218214
static PyObject *
219-
_io__IOBase_readlines(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
215+
_io__IOBase_readlines(PyObject *self, PyObject **args, Py_ssize_t nargs)
220216
{
221217
PyObject *return_value = NULL;
222218
Py_ssize_t hint = -1;
223219

224-
if (!_PyArg_NoStackKeywords("readlines", kwnames)) {
225-
goto exit;
226-
}
227-
228220
if (!_PyArg_ParseStack(args, nargs, "|O&:readlines",
229221
_Py_convert_optional_to_ssize_t, &hint)) {
230222
goto exit;
@@ -255,15 +247,11 @@ static PyObject *
255247
_io__RawIOBase_read_impl(PyObject *self, Py_ssize_t n);
256248

257249
static PyObject *
258-
_io__RawIOBase_read(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
250+
_io__RawIOBase_read(PyObject *self, PyObject **args, Py_ssize_t nargs)
259251
{
260252
PyObject *return_value = NULL;
261253
Py_ssize_t n = -1;
262254

263-
if (!_PyArg_NoStackKeywords("read", kwnames)) {
264-
goto exit;
265-
}
266-
267255
if (!_PyArg_ParseStack(args, nargs, "|n:read",
268256
&n)) {
269257
goto exit;
@@ -291,4 +279,4 @@ _io__RawIOBase_readall(PyObject *self, PyObject *Py_UNUSED(ignored))
291279
{
292280
return _io__RawIOBase_readall_impl(self);
293281
}
294-
/*[clinic end generated code: output=8361ae8d81d072bf input=a9049054013a1b77]*/
282+
/*[clinic end generated code: output=1dc5cc1a9977d73f input=a9049054013a1b77]*/

0 commit comments

Comments
 (0)