Branch data Line data Source code
1 : : /*[clinic input]
2 : : preserve
3 : : [clinic start generated code]*/
4 : :
5 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
6 : : # include "pycore_gc.h" // PyGC_Head
7 : : # include "pycore_runtime.h" // _Py_ID()
8 : : #endif
9 : :
10 : :
11 : : PyDoc_STRVAR(test_empty_function__doc__,
12 : : "test_empty_function($module, /)\n"
13 : : "--\n"
14 : : "\n");
15 : :
16 : : #define TEST_EMPTY_FUNCTION_METHODDEF \
17 : : {"test_empty_function", (PyCFunction)test_empty_function, METH_NOARGS, test_empty_function__doc__},
18 : :
19 : : static PyObject *
20 : : test_empty_function_impl(PyObject *module);
21 : :
22 : : static PyObject *
23 : 0 : test_empty_function(PyObject *module, PyObject *Py_UNUSED(ignored))
24 : : {
25 : 0 : return test_empty_function_impl(module);
26 : : }
27 : :
28 : : PyDoc_STRVAR(objects_converter__doc__,
29 : : "objects_converter($module, a, b=<unrepresentable>, /)\n"
30 : : "--\n"
31 : : "\n");
32 : :
33 : : #define OBJECTS_CONVERTER_METHODDEF \
34 : : {"objects_converter", _PyCFunction_CAST(objects_converter), METH_FASTCALL, objects_converter__doc__},
35 : :
36 : : static PyObject *
37 : : objects_converter_impl(PyObject *module, PyObject *a, PyObject *b);
38 : :
39 : : static PyObject *
40 : 0 : objects_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
41 : : {
42 : 0 : PyObject *return_value = NULL;
43 : : PyObject *a;
44 : 0 : PyObject *b = NULL;
45 : :
46 [ # # # # : 0 : if (!_PyArg_CheckPositional("objects_converter", nargs, 1, 2)) {
# # ]
47 : 0 : goto exit;
48 : : }
49 : 0 : a = args[0];
50 [ # # ]: 0 : if (nargs < 2) {
51 : 0 : goto skip_optional;
52 : : }
53 : 0 : b = args[1];
54 : 0 : skip_optional:
55 : 0 : return_value = objects_converter_impl(module, a, b);
56 : :
57 : 0 : exit:
58 : 0 : return return_value;
59 : : }
60 : :
61 : : PyDoc_STRVAR(bytes_object_converter__doc__,
62 : : "bytes_object_converter($module, a, /)\n"
63 : : "--\n"
64 : : "\n");
65 : :
66 : : #define BYTES_OBJECT_CONVERTER_METHODDEF \
67 : : {"bytes_object_converter", (PyCFunction)bytes_object_converter, METH_O, bytes_object_converter__doc__},
68 : :
69 : : static PyObject *
70 : : bytes_object_converter_impl(PyObject *module, PyBytesObject *a);
71 : :
72 : : static PyObject *
73 : 0 : bytes_object_converter(PyObject *module, PyObject *arg)
74 : : {
75 : 0 : PyObject *return_value = NULL;
76 : : PyBytesObject *a;
77 : :
78 [ # # ]: 0 : if (!PyBytes_Check(arg)) {
79 : 0 : _PyArg_BadArgument("bytes_object_converter", "argument", "bytes", arg);
80 : 0 : goto exit;
81 : : }
82 : 0 : a = (PyBytesObject *)arg;
83 : 0 : return_value = bytes_object_converter_impl(module, a);
84 : :
85 : 0 : exit:
86 : 0 : return return_value;
87 : : }
88 : :
89 : : PyDoc_STRVAR(byte_array_object_converter__doc__,
90 : : "byte_array_object_converter($module, a, /)\n"
91 : : "--\n"
92 : : "\n");
93 : :
94 : : #define BYTE_ARRAY_OBJECT_CONVERTER_METHODDEF \
95 : : {"byte_array_object_converter", (PyCFunction)byte_array_object_converter, METH_O, byte_array_object_converter__doc__},
96 : :
97 : : static PyObject *
98 : : byte_array_object_converter_impl(PyObject *module, PyByteArrayObject *a);
99 : :
100 : : static PyObject *
101 : 0 : byte_array_object_converter(PyObject *module, PyObject *arg)
102 : : {
103 : 0 : PyObject *return_value = NULL;
104 : : PyByteArrayObject *a;
105 : :
106 [ # # ]: 0 : if (!PyByteArray_Check(arg)) {
107 : 0 : _PyArg_BadArgument("byte_array_object_converter", "argument", "bytearray", arg);
108 : 0 : goto exit;
109 : : }
110 : 0 : a = (PyByteArrayObject *)arg;
111 : 0 : return_value = byte_array_object_converter_impl(module, a);
112 : :
113 : 0 : exit:
114 : 0 : return return_value;
115 : : }
116 : :
117 : : PyDoc_STRVAR(unicode_converter__doc__,
118 : : "unicode_converter($module, a, /)\n"
119 : : "--\n"
120 : : "\n");
121 : :
122 : : #define UNICODE_CONVERTER_METHODDEF \
123 : : {"unicode_converter", (PyCFunction)unicode_converter, METH_O, unicode_converter__doc__},
124 : :
125 : : static PyObject *
126 : : unicode_converter_impl(PyObject *module, PyObject *a);
127 : :
128 : : static PyObject *
129 : 0 : unicode_converter(PyObject *module, PyObject *arg)
130 : : {
131 : 0 : PyObject *return_value = NULL;
132 : : PyObject *a;
133 : :
134 [ # # ]: 0 : if (!PyUnicode_Check(arg)) {
135 : 0 : _PyArg_BadArgument("unicode_converter", "argument", "str", arg);
136 : 0 : goto exit;
137 : : }
138 [ # # ]: 0 : if (PyUnicode_READY(arg) == -1) {
139 : 0 : goto exit;
140 : : }
141 : 0 : a = arg;
142 : 0 : return_value = unicode_converter_impl(module, a);
143 : :
144 : 0 : exit:
145 : 0 : return return_value;
146 : : }
147 : :
148 : : PyDoc_STRVAR(bool_converter__doc__,
149 : : "bool_converter($module, a=True, b=True, c=True, /)\n"
150 : : "--\n"
151 : : "\n");
152 : :
153 : : #define BOOL_CONVERTER_METHODDEF \
154 : : {"bool_converter", _PyCFunction_CAST(bool_converter), METH_FASTCALL, bool_converter__doc__},
155 : :
156 : : static PyObject *
157 : : bool_converter_impl(PyObject *module, int a, int b, int c);
158 : :
159 : : static PyObject *
160 : 0 : bool_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
161 : : {
162 : 0 : PyObject *return_value = NULL;
163 : 0 : int a = 1;
164 : 0 : int b = 1;
165 : 0 : int c = 1;
166 : :
167 [ # # # # : 0 : if (!_PyArg_CheckPositional("bool_converter", nargs, 0, 3)) {
# # ]
168 : 0 : goto exit;
169 : : }
170 [ # # ]: 0 : if (nargs < 1) {
171 : 0 : goto skip_optional;
172 : : }
173 : 0 : a = PyObject_IsTrue(args[0]);
174 [ # # ]: 0 : if (a < 0) {
175 : 0 : goto exit;
176 : : }
177 [ # # ]: 0 : if (nargs < 2) {
178 : 0 : goto skip_optional;
179 : : }
180 : 0 : b = PyObject_IsTrue(args[1]);
181 [ # # ]: 0 : if (b < 0) {
182 : 0 : goto exit;
183 : : }
184 [ # # ]: 0 : if (nargs < 3) {
185 : 0 : goto skip_optional;
186 : : }
187 : 0 : c = _PyLong_AsInt(args[2]);
188 [ # # # # ]: 0 : if (c == -1 && PyErr_Occurred()) {
189 : 0 : goto exit;
190 : : }
191 : 0 : skip_optional:
192 : 0 : return_value = bool_converter_impl(module, a, b, c);
193 : :
194 : 0 : exit:
195 : 0 : return return_value;
196 : : }
197 : :
198 : : PyDoc_STRVAR(char_converter__doc__,
199 : : "char_converter($module, a=b\'A\', b=b\'\\x07\', c=b\'\\x08\', d=b\'\\t\', e=b\'\\n\',\n"
200 : : " f=b\'\\x0b\', g=b\'\\x0c\', h=b\'\\r\', i=b\'\"\', j=b\"\'\", k=b\'?\',\n"
201 : : " l=b\'\\\\\', m=b\'\\x00\', n=b\'\\xff\', /)\n"
202 : : "--\n"
203 : : "\n");
204 : :
205 : : #define CHAR_CONVERTER_METHODDEF \
206 : : {"char_converter", _PyCFunction_CAST(char_converter), METH_FASTCALL, char_converter__doc__},
207 : :
208 : : static PyObject *
209 : : char_converter_impl(PyObject *module, char a, char b, char c, char d, char e,
210 : : char f, char g, char h, char i, char j, char k, char l,
211 : : char m, char n);
212 : :
213 : : static PyObject *
214 : 0 : char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
215 : : {
216 : 0 : PyObject *return_value = NULL;
217 : 0 : char a = 'A';
218 : 0 : char b = '\x07';
219 : 0 : char c = '\x08';
220 : 0 : char d = '\t';
221 : 0 : char e = '\n';
222 : 0 : char f = '\x0b';
223 : 0 : char g = '\x0c';
224 : 0 : char h = '\r';
225 : 0 : char i = '"';
226 : 0 : char j = '\'';
227 : 0 : char k = '?';
228 : 0 : char l = '\\';
229 : 0 : char m = '\x00';
230 : 0 : char n = '\xff';
231 : :
232 [ # # # # : 0 : if (!_PyArg_CheckPositional("char_converter", nargs, 0, 14)) {
# # ]
233 : 0 : goto exit;
234 : : }
235 [ # # ]: 0 : if (nargs < 1) {
236 : 0 : goto skip_optional;
237 : : }
238 [ # # # # ]: 0 : if (PyBytes_Check(args[0]) && PyBytes_GET_SIZE(args[0]) == 1) {
239 : 0 : a = PyBytes_AS_STRING(args[0])[0];
240 : : }
241 [ # # # # ]: 0 : else if (PyByteArray_Check(args[0]) && PyByteArray_GET_SIZE(args[0]) == 1) {
242 : 0 : a = PyByteArray_AS_STRING(args[0])[0];
243 : : }
244 : : else {
245 : 0 : _PyArg_BadArgument("char_converter", "argument 1", "a byte string of length 1", args[0]);
246 : 0 : goto exit;
247 : : }
248 [ # # ]: 0 : if (nargs < 2) {
249 : 0 : goto skip_optional;
250 : : }
251 [ # # # # ]: 0 : if (PyBytes_Check(args[1]) && PyBytes_GET_SIZE(args[1]) == 1) {
252 : 0 : b = PyBytes_AS_STRING(args[1])[0];
253 : : }
254 [ # # # # ]: 0 : else if (PyByteArray_Check(args[1]) && PyByteArray_GET_SIZE(args[1]) == 1) {
255 : 0 : b = PyByteArray_AS_STRING(args[1])[0];
256 : : }
257 : : else {
258 : 0 : _PyArg_BadArgument("char_converter", "argument 2", "a byte string of length 1", args[1]);
259 : 0 : goto exit;
260 : : }
261 [ # # ]: 0 : if (nargs < 3) {
262 : 0 : goto skip_optional;
263 : : }
264 [ # # # # ]: 0 : if (PyBytes_Check(args[2]) && PyBytes_GET_SIZE(args[2]) == 1) {
265 : 0 : c = PyBytes_AS_STRING(args[2])[0];
266 : : }
267 [ # # # # ]: 0 : else if (PyByteArray_Check(args[2]) && PyByteArray_GET_SIZE(args[2]) == 1) {
268 : 0 : c = PyByteArray_AS_STRING(args[2])[0];
269 : : }
270 : : else {
271 : 0 : _PyArg_BadArgument("char_converter", "argument 3", "a byte string of length 1", args[2]);
272 : 0 : goto exit;
273 : : }
274 [ # # ]: 0 : if (nargs < 4) {
275 : 0 : goto skip_optional;
276 : : }
277 [ # # # # ]: 0 : if (PyBytes_Check(args[3]) && PyBytes_GET_SIZE(args[3]) == 1) {
278 : 0 : d = PyBytes_AS_STRING(args[3])[0];
279 : : }
280 [ # # # # ]: 0 : else if (PyByteArray_Check(args[3]) && PyByteArray_GET_SIZE(args[3]) == 1) {
281 : 0 : d = PyByteArray_AS_STRING(args[3])[0];
282 : : }
283 : : else {
284 : 0 : _PyArg_BadArgument("char_converter", "argument 4", "a byte string of length 1", args[3]);
285 : 0 : goto exit;
286 : : }
287 [ # # ]: 0 : if (nargs < 5) {
288 : 0 : goto skip_optional;
289 : : }
290 [ # # # # ]: 0 : if (PyBytes_Check(args[4]) && PyBytes_GET_SIZE(args[4]) == 1) {
291 : 0 : e = PyBytes_AS_STRING(args[4])[0];
292 : : }
293 [ # # # # ]: 0 : else if (PyByteArray_Check(args[4]) && PyByteArray_GET_SIZE(args[4]) == 1) {
294 : 0 : e = PyByteArray_AS_STRING(args[4])[0];
295 : : }
296 : : else {
297 : 0 : _PyArg_BadArgument("char_converter", "argument 5", "a byte string of length 1", args[4]);
298 : 0 : goto exit;
299 : : }
300 [ # # ]: 0 : if (nargs < 6) {
301 : 0 : goto skip_optional;
302 : : }
303 [ # # # # ]: 0 : if (PyBytes_Check(args[5]) && PyBytes_GET_SIZE(args[5]) == 1) {
304 : 0 : f = PyBytes_AS_STRING(args[5])[0];
305 : : }
306 [ # # # # ]: 0 : else if (PyByteArray_Check(args[5]) && PyByteArray_GET_SIZE(args[5]) == 1) {
307 : 0 : f = PyByteArray_AS_STRING(args[5])[0];
308 : : }
309 : : else {
310 : 0 : _PyArg_BadArgument("char_converter", "argument 6", "a byte string of length 1", args[5]);
311 : 0 : goto exit;
312 : : }
313 [ # # ]: 0 : if (nargs < 7) {
314 : 0 : goto skip_optional;
315 : : }
316 [ # # # # ]: 0 : if (PyBytes_Check(args[6]) && PyBytes_GET_SIZE(args[6]) == 1) {
317 : 0 : g = PyBytes_AS_STRING(args[6])[0];
318 : : }
319 [ # # # # ]: 0 : else if (PyByteArray_Check(args[6]) && PyByteArray_GET_SIZE(args[6]) == 1) {
320 : 0 : g = PyByteArray_AS_STRING(args[6])[0];
321 : : }
322 : : else {
323 : 0 : _PyArg_BadArgument("char_converter", "argument 7", "a byte string of length 1", args[6]);
324 : 0 : goto exit;
325 : : }
326 [ # # ]: 0 : if (nargs < 8) {
327 : 0 : goto skip_optional;
328 : : }
329 [ # # # # ]: 0 : if (PyBytes_Check(args[7]) && PyBytes_GET_SIZE(args[7]) == 1) {
330 : 0 : h = PyBytes_AS_STRING(args[7])[0];
331 : : }
332 [ # # # # ]: 0 : else if (PyByteArray_Check(args[7]) && PyByteArray_GET_SIZE(args[7]) == 1) {
333 : 0 : h = PyByteArray_AS_STRING(args[7])[0];
334 : : }
335 : : else {
336 : 0 : _PyArg_BadArgument("char_converter", "argument 8", "a byte string of length 1", args[7]);
337 : 0 : goto exit;
338 : : }
339 [ # # ]: 0 : if (nargs < 9) {
340 : 0 : goto skip_optional;
341 : : }
342 [ # # # # ]: 0 : if (PyBytes_Check(args[8]) && PyBytes_GET_SIZE(args[8]) == 1) {
343 : 0 : i = PyBytes_AS_STRING(args[8])[0];
344 : : }
345 [ # # # # ]: 0 : else if (PyByteArray_Check(args[8]) && PyByteArray_GET_SIZE(args[8]) == 1) {
346 : 0 : i = PyByteArray_AS_STRING(args[8])[0];
347 : : }
348 : : else {
349 : 0 : _PyArg_BadArgument("char_converter", "argument 9", "a byte string of length 1", args[8]);
350 : 0 : goto exit;
351 : : }
352 [ # # ]: 0 : if (nargs < 10) {
353 : 0 : goto skip_optional;
354 : : }
355 [ # # # # ]: 0 : if (PyBytes_Check(args[9]) && PyBytes_GET_SIZE(args[9]) == 1) {
356 : 0 : j = PyBytes_AS_STRING(args[9])[0];
357 : : }
358 [ # # # # ]: 0 : else if (PyByteArray_Check(args[9]) && PyByteArray_GET_SIZE(args[9]) == 1) {
359 : 0 : j = PyByteArray_AS_STRING(args[9])[0];
360 : : }
361 : : else {
362 : 0 : _PyArg_BadArgument("char_converter", "argument 10", "a byte string of length 1", args[9]);
363 : 0 : goto exit;
364 : : }
365 [ # # ]: 0 : if (nargs < 11) {
366 : 0 : goto skip_optional;
367 : : }
368 [ # # # # ]: 0 : if (PyBytes_Check(args[10]) && PyBytes_GET_SIZE(args[10]) == 1) {
369 : 0 : k = PyBytes_AS_STRING(args[10])[0];
370 : : }
371 [ # # # # ]: 0 : else if (PyByteArray_Check(args[10]) && PyByteArray_GET_SIZE(args[10]) == 1) {
372 : 0 : k = PyByteArray_AS_STRING(args[10])[0];
373 : : }
374 : : else {
375 : 0 : _PyArg_BadArgument("char_converter", "argument 11", "a byte string of length 1", args[10]);
376 : 0 : goto exit;
377 : : }
378 [ # # ]: 0 : if (nargs < 12) {
379 : 0 : goto skip_optional;
380 : : }
381 [ # # # # ]: 0 : if (PyBytes_Check(args[11]) && PyBytes_GET_SIZE(args[11]) == 1) {
382 : 0 : l = PyBytes_AS_STRING(args[11])[0];
383 : : }
384 [ # # # # ]: 0 : else if (PyByteArray_Check(args[11]) && PyByteArray_GET_SIZE(args[11]) == 1) {
385 : 0 : l = PyByteArray_AS_STRING(args[11])[0];
386 : : }
387 : : else {
388 : 0 : _PyArg_BadArgument("char_converter", "argument 12", "a byte string of length 1", args[11]);
389 : 0 : goto exit;
390 : : }
391 [ # # ]: 0 : if (nargs < 13) {
392 : 0 : goto skip_optional;
393 : : }
394 [ # # # # ]: 0 : if (PyBytes_Check(args[12]) && PyBytes_GET_SIZE(args[12]) == 1) {
395 : 0 : m = PyBytes_AS_STRING(args[12])[0];
396 : : }
397 [ # # # # ]: 0 : else if (PyByteArray_Check(args[12]) && PyByteArray_GET_SIZE(args[12]) == 1) {
398 : 0 : m = PyByteArray_AS_STRING(args[12])[0];
399 : : }
400 : : else {
401 : 0 : _PyArg_BadArgument("char_converter", "argument 13", "a byte string of length 1", args[12]);
402 : 0 : goto exit;
403 : : }
404 [ # # ]: 0 : if (nargs < 14) {
405 : 0 : goto skip_optional;
406 : : }
407 [ # # # # ]: 0 : if (PyBytes_Check(args[13]) && PyBytes_GET_SIZE(args[13]) == 1) {
408 : 0 : n = PyBytes_AS_STRING(args[13])[0];
409 : : }
410 [ # # # # ]: 0 : else if (PyByteArray_Check(args[13]) && PyByteArray_GET_SIZE(args[13]) == 1) {
411 : 0 : n = PyByteArray_AS_STRING(args[13])[0];
412 : : }
413 : : else {
414 : 0 : _PyArg_BadArgument("char_converter", "argument 14", "a byte string of length 1", args[13]);
415 : 0 : goto exit;
416 : : }
417 : 0 : skip_optional:
418 : 0 : return_value = char_converter_impl(module, a, b, c, d, e, f, g, h, i, j, k, l, m, n);
419 : :
420 : 0 : exit:
421 : 0 : return return_value;
422 : : }
423 : :
424 : : PyDoc_STRVAR(unsigned_char_converter__doc__,
425 : : "unsigned_char_converter($module, a=12, b=34, c=56, /)\n"
426 : : "--\n"
427 : : "\n");
428 : :
429 : : #define UNSIGNED_CHAR_CONVERTER_METHODDEF \
430 : : {"unsigned_char_converter", _PyCFunction_CAST(unsigned_char_converter), METH_FASTCALL, unsigned_char_converter__doc__},
431 : :
432 : : static PyObject *
433 : : unsigned_char_converter_impl(PyObject *module, unsigned char a,
434 : : unsigned char b, unsigned char c);
435 : :
436 : : static PyObject *
437 : 0 : unsigned_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
438 : : {
439 : 0 : PyObject *return_value = NULL;
440 : 0 : unsigned char a = 12;
441 : 0 : unsigned char b = 34;
442 : 0 : unsigned char c = 56;
443 : :
444 [ # # # # : 0 : if (!_PyArg_CheckPositional("unsigned_char_converter", nargs, 0, 3)) {
# # ]
445 : 0 : goto exit;
446 : : }
447 [ # # ]: 0 : if (nargs < 1) {
448 : 0 : goto skip_optional;
449 : : }
450 : : {
451 : 0 : long ival = PyLong_AsLong(args[0]);
452 [ # # # # ]: 0 : if (ival == -1 && PyErr_Occurred()) {
453 : 0 : goto exit;
454 : : }
455 [ # # ]: 0 : else if (ival < 0) {
456 : 0 : PyErr_SetString(PyExc_OverflowError,
457 : : "unsigned byte integer is less than minimum");
458 : 0 : goto exit;
459 : : }
460 [ # # ]: 0 : else if (ival > UCHAR_MAX) {
461 : 0 : PyErr_SetString(PyExc_OverflowError,
462 : : "unsigned byte integer is greater than maximum");
463 : 0 : goto exit;
464 : : }
465 : : else {
466 : 0 : a = (unsigned char) ival;
467 : : }
468 : : }
469 [ # # ]: 0 : if (nargs < 2) {
470 : 0 : goto skip_optional;
471 : : }
472 : : {
473 : 0 : long ival = PyLong_AsLong(args[1]);
474 [ # # # # ]: 0 : if (ival == -1 && PyErr_Occurred()) {
475 : 0 : goto exit;
476 : : }
477 [ # # ]: 0 : else if (ival < 0) {
478 : 0 : PyErr_SetString(PyExc_OverflowError,
479 : : "unsigned byte integer is less than minimum");
480 : 0 : goto exit;
481 : : }
482 [ # # ]: 0 : else if (ival > UCHAR_MAX) {
483 : 0 : PyErr_SetString(PyExc_OverflowError,
484 : : "unsigned byte integer is greater than maximum");
485 : 0 : goto exit;
486 : : }
487 : : else {
488 : 0 : b = (unsigned char) ival;
489 : : }
490 : : }
491 [ # # ]: 0 : if (nargs < 3) {
492 : 0 : goto skip_optional;
493 : : }
494 : : {
495 : 0 : unsigned long ival = PyLong_AsUnsignedLongMask(args[2]);
496 [ # # # # ]: 0 : if (ival == (unsigned long)-1 && PyErr_Occurred()) {
497 : 0 : goto exit;
498 : : }
499 : : else {
500 : 0 : c = (unsigned char) ival;
501 : : }
502 : : }
503 : 0 : skip_optional:
504 : 0 : return_value = unsigned_char_converter_impl(module, a, b, c);
505 : :
506 : 0 : exit:
507 : 0 : return return_value;
508 : : }
509 : :
510 : : PyDoc_STRVAR(short_converter__doc__,
511 : : "short_converter($module, a=12, /)\n"
512 : : "--\n"
513 : : "\n");
514 : :
515 : : #define SHORT_CONVERTER_METHODDEF \
516 : : {"short_converter", _PyCFunction_CAST(short_converter), METH_FASTCALL, short_converter__doc__},
517 : :
518 : : static PyObject *
519 : : short_converter_impl(PyObject *module, short a);
520 : :
521 : : static PyObject *
522 : 0 : short_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
523 : : {
524 : 0 : PyObject *return_value = NULL;
525 : 0 : short a = 12;
526 : :
527 [ # # # # : 0 : if (!_PyArg_CheckPositional("short_converter", nargs, 0, 1)) {
# # ]
528 : 0 : goto exit;
529 : : }
530 [ # # ]: 0 : if (nargs < 1) {
531 : 0 : goto skip_optional;
532 : : }
533 : : {
534 : 0 : long ival = PyLong_AsLong(args[0]);
535 [ # # # # ]: 0 : if (ival == -1 && PyErr_Occurred()) {
536 : 0 : goto exit;
537 : : }
538 [ # # ]: 0 : else if (ival < SHRT_MIN) {
539 : 0 : PyErr_SetString(PyExc_OverflowError,
540 : : "signed short integer is less than minimum");
541 : 0 : goto exit;
542 : : }
543 [ # # ]: 0 : else if (ival > SHRT_MAX) {
544 : 0 : PyErr_SetString(PyExc_OverflowError,
545 : : "signed short integer is greater than maximum");
546 : 0 : goto exit;
547 : : }
548 : : else {
549 : 0 : a = (short) ival;
550 : : }
551 : : }
552 : 0 : skip_optional:
553 : 0 : return_value = short_converter_impl(module, a);
554 : :
555 : 0 : exit:
556 : 0 : return return_value;
557 : : }
558 : :
559 : : PyDoc_STRVAR(unsigned_short_converter__doc__,
560 : : "unsigned_short_converter($module, a=12, b=34, c=56, /)\n"
561 : : "--\n"
562 : : "\n");
563 : :
564 : : #define UNSIGNED_SHORT_CONVERTER_METHODDEF \
565 : : {"unsigned_short_converter", _PyCFunction_CAST(unsigned_short_converter), METH_FASTCALL, unsigned_short_converter__doc__},
566 : :
567 : : static PyObject *
568 : : unsigned_short_converter_impl(PyObject *module, unsigned short a,
569 : : unsigned short b, unsigned short c);
570 : :
571 : : static PyObject *
572 : 0 : unsigned_short_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
573 : : {
574 : 0 : PyObject *return_value = NULL;
575 : 0 : unsigned short a = 12;
576 : 0 : unsigned short b = 34;
577 : 0 : unsigned short c = 56;
578 : :
579 [ # # # # : 0 : if (!_PyArg_CheckPositional("unsigned_short_converter", nargs, 0, 3)) {
# # ]
580 : 0 : goto exit;
581 : : }
582 [ # # ]: 0 : if (nargs < 1) {
583 : 0 : goto skip_optional;
584 : : }
585 [ # # ]: 0 : if (!_PyLong_UnsignedShort_Converter(args[0], &a)) {
586 : 0 : goto exit;
587 : : }
588 [ # # ]: 0 : if (nargs < 2) {
589 : 0 : goto skip_optional;
590 : : }
591 [ # # ]: 0 : if (!_PyLong_UnsignedShort_Converter(args[1], &b)) {
592 : 0 : goto exit;
593 : : }
594 [ # # ]: 0 : if (nargs < 3) {
595 : 0 : goto skip_optional;
596 : : }
597 : 0 : c = (unsigned short)PyLong_AsUnsignedLongMask(args[2]);
598 [ # # # # ]: 0 : if (c == (unsigned short)-1 && PyErr_Occurred()) {
599 : 0 : goto exit;
600 : : }
601 : 0 : skip_optional:
602 : 0 : return_value = unsigned_short_converter_impl(module, a, b, c);
603 : :
604 : 0 : exit:
605 : 0 : return return_value;
606 : : }
607 : :
608 : : PyDoc_STRVAR(int_converter__doc__,
609 : : "int_converter($module, a=12, b=34, c=45, /)\n"
610 : : "--\n"
611 : : "\n");
612 : :
613 : : #define INT_CONVERTER_METHODDEF \
614 : : {"int_converter", _PyCFunction_CAST(int_converter), METH_FASTCALL, int_converter__doc__},
615 : :
616 : : static PyObject *
617 : : int_converter_impl(PyObject *module, int a, int b, int c);
618 : :
619 : : static PyObject *
620 : 0 : int_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
621 : : {
622 : 0 : PyObject *return_value = NULL;
623 : 0 : int a = 12;
624 : 0 : int b = 34;
625 : 0 : int c = 45;
626 : :
627 [ # # # # : 0 : if (!_PyArg_CheckPositional("int_converter", nargs, 0, 3)) {
# # ]
628 : 0 : goto exit;
629 : : }
630 [ # # ]: 0 : if (nargs < 1) {
631 : 0 : goto skip_optional;
632 : : }
633 : 0 : a = _PyLong_AsInt(args[0]);
634 [ # # # # ]: 0 : if (a == -1 && PyErr_Occurred()) {
635 : 0 : goto exit;
636 : : }
637 [ # # ]: 0 : if (nargs < 2) {
638 : 0 : goto skip_optional;
639 : : }
640 : 0 : b = _PyLong_AsInt(args[1]);
641 [ # # # # ]: 0 : if (b == -1 && PyErr_Occurred()) {
642 : 0 : goto exit;
643 : : }
644 [ # # ]: 0 : if (nargs < 3) {
645 : 0 : goto skip_optional;
646 : : }
647 [ # # ]: 0 : if (!PyUnicode_Check(args[2])) {
648 : 0 : _PyArg_BadArgument("int_converter", "argument 3", "a unicode character", args[2]);
649 : 0 : goto exit;
650 : : }
651 [ # # ]: 0 : if (PyUnicode_READY(args[2])) {
652 : 0 : goto exit;
653 : : }
654 [ # # ]: 0 : if (PyUnicode_GET_LENGTH(args[2]) != 1) {
655 : 0 : _PyArg_BadArgument("int_converter", "argument 3", "a unicode character", args[2]);
656 : 0 : goto exit;
657 : : }
658 : 0 : c = PyUnicode_READ_CHAR(args[2], 0);
659 : 0 : skip_optional:
660 : 0 : return_value = int_converter_impl(module, a, b, c);
661 : :
662 : 0 : exit:
663 : 0 : return return_value;
664 : : }
665 : :
666 : : PyDoc_STRVAR(unsigned_int_converter__doc__,
667 : : "unsigned_int_converter($module, a=12, b=34, c=56, /)\n"
668 : : "--\n"
669 : : "\n");
670 : :
671 : : #define UNSIGNED_INT_CONVERTER_METHODDEF \
672 : : {"unsigned_int_converter", _PyCFunction_CAST(unsigned_int_converter), METH_FASTCALL, unsigned_int_converter__doc__},
673 : :
674 : : static PyObject *
675 : : unsigned_int_converter_impl(PyObject *module, unsigned int a, unsigned int b,
676 : : unsigned int c);
677 : :
678 : : static PyObject *
679 : 0 : unsigned_int_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
680 : : {
681 : 0 : PyObject *return_value = NULL;
682 : 0 : unsigned int a = 12;
683 : 0 : unsigned int b = 34;
684 : 0 : unsigned int c = 56;
685 : :
686 [ # # # # : 0 : if (!_PyArg_CheckPositional("unsigned_int_converter", nargs, 0, 3)) {
# # ]
687 : 0 : goto exit;
688 : : }
689 [ # # ]: 0 : if (nargs < 1) {
690 : 0 : goto skip_optional;
691 : : }
692 [ # # ]: 0 : if (!_PyLong_UnsignedInt_Converter(args[0], &a)) {
693 : 0 : goto exit;
694 : : }
695 [ # # ]: 0 : if (nargs < 2) {
696 : 0 : goto skip_optional;
697 : : }
698 [ # # ]: 0 : if (!_PyLong_UnsignedInt_Converter(args[1], &b)) {
699 : 0 : goto exit;
700 : : }
701 [ # # ]: 0 : if (nargs < 3) {
702 : 0 : goto skip_optional;
703 : : }
704 : 0 : c = (unsigned int)PyLong_AsUnsignedLongMask(args[2]);
705 [ # # # # ]: 0 : if (c == (unsigned int)-1 && PyErr_Occurred()) {
706 : 0 : goto exit;
707 : : }
708 : 0 : skip_optional:
709 : 0 : return_value = unsigned_int_converter_impl(module, a, b, c);
710 : :
711 : 0 : exit:
712 : 0 : return return_value;
713 : : }
714 : :
715 : : PyDoc_STRVAR(long_converter__doc__,
716 : : "long_converter($module, a=12, /)\n"
717 : : "--\n"
718 : : "\n");
719 : :
720 : : #define LONG_CONVERTER_METHODDEF \
721 : : {"long_converter", _PyCFunction_CAST(long_converter), METH_FASTCALL, long_converter__doc__},
722 : :
723 : : static PyObject *
724 : : long_converter_impl(PyObject *module, long a);
725 : :
726 : : static PyObject *
727 : 0 : long_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
728 : : {
729 : 0 : PyObject *return_value = NULL;
730 : 0 : long a = 12;
731 : :
732 [ # # # # : 0 : if (!_PyArg_CheckPositional("long_converter", nargs, 0, 1)) {
# # ]
733 : 0 : goto exit;
734 : : }
735 [ # # ]: 0 : if (nargs < 1) {
736 : 0 : goto skip_optional;
737 : : }
738 : 0 : a = PyLong_AsLong(args[0]);
739 [ # # # # ]: 0 : if (a == -1 && PyErr_Occurred()) {
740 : 0 : goto exit;
741 : : }
742 : 0 : skip_optional:
743 : 0 : return_value = long_converter_impl(module, a);
744 : :
745 : 0 : exit:
746 : 0 : return return_value;
747 : : }
748 : :
749 : : PyDoc_STRVAR(unsigned_long_converter__doc__,
750 : : "unsigned_long_converter($module, a=12, b=34, c=56, /)\n"
751 : : "--\n"
752 : : "\n");
753 : :
754 : : #define UNSIGNED_LONG_CONVERTER_METHODDEF \
755 : : {"unsigned_long_converter", _PyCFunction_CAST(unsigned_long_converter), METH_FASTCALL, unsigned_long_converter__doc__},
756 : :
757 : : static PyObject *
758 : : unsigned_long_converter_impl(PyObject *module, unsigned long a,
759 : : unsigned long b, unsigned long c);
760 : :
761 : : static PyObject *
762 : 0 : unsigned_long_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
763 : : {
764 : 0 : PyObject *return_value = NULL;
765 : 0 : unsigned long a = 12;
766 : 0 : unsigned long b = 34;
767 : 0 : unsigned long c = 56;
768 : :
769 [ # # # # : 0 : if (!_PyArg_CheckPositional("unsigned_long_converter", nargs, 0, 3)) {
# # ]
770 : 0 : goto exit;
771 : : }
772 [ # # ]: 0 : if (nargs < 1) {
773 : 0 : goto skip_optional;
774 : : }
775 [ # # ]: 0 : if (!_PyLong_UnsignedLong_Converter(args[0], &a)) {
776 : 0 : goto exit;
777 : : }
778 [ # # ]: 0 : if (nargs < 2) {
779 : 0 : goto skip_optional;
780 : : }
781 [ # # ]: 0 : if (!_PyLong_UnsignedLong_Converter(args[1], &b)) {
782 : 0 : goto exit;
783 : : }
784 [ # # ]: 0 : if (nargs < 3) {
785 : 0 : goto skip_optional;
786 : : }
787 [ # # ]: 0 : if (!PyLong_Check(args[2])) {
788 : 0 : _PyArg_BadArgument("unsigned_long_converter", "argument 3", "int", args[2]);
789 : 0 : goto exit;
790 : : }
791 : 0 : c = PyLong_AsUnsignedLongMask(args[2]);
792 : 0 : skip_optional:
793 : 0 : return_value = unsigned_long_converter_impl(module, a, b, c);
794 : :
795 : 0 : exit:
796 : 0 : return return_value;
797 : : }
798 : :
799 : : PyDoc_STRVAR(long_long_converter__doc__,
800 : : "long_long_converter($module, a=12, /)\n"
801 : : "--\n"
802 : : "\n");
803 : :
804 : : #define LONG_LONG_CONVERTER_METHODDEF \
805 : : {"long_long_converter", _PyCFunction_CAST(long_long_converter), METH_FASTCALL, long_long_converter__doc__},
806 : :
807 : : static PyObject *
808 : : long_long_converter_impl(PyObject *module, long long a);
809 : :
810 : : static PyObject *
811 : 0 : long_long_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
812 : : {
813 : 0 : PyObject *return_value = NULL;
814 : 0 : long long a = 12;
815 : :
816 [ # # # # : 0 : if (!_PyArg_CheckPositional("long_long_converter", nargs, 0, 1)) {
# # ]
817 : 0 : goto exit;
818 : : }
819 [ # # ]: 0 : if (nargs < 1) {
820 : 0 : goto skip_optional;
821 : : }
822 : 0 : a = PyLong_AsLongLong(args[0]);
823 [ # # # # ]: 0 : if (a == -1 && PyErr_Occurred()) {
824 : 0 : goto exit;
825 : : }
826 : 0 : skip_optional:
827 : 0 : return_value = long_long_converter_impl(module, a);
828 : :
829 : 0 : exit:
830 : 0 : return return_value;
831 : : }
832 : :
833 : : PyDoc_STRVAR(unsigned_long_long_converter__doc__,
834 : : "unsigned_long_long_converter($module, a=12, b=34, c=56, /)\n"
835 : : "--\n"
836 : : "\n");
837 : :
838 : : #define UNSIGNED_LONG_LONG_CONVERTER_METHODDEF \
839 : : {"unsigned_long_long_converter", _PyCFunction_CAST(unsigned_long_long_converter), METH_FASTCALL, unsigned_long_long_converter__doc__},
840 : :
841 : : static PyObject *
842 : : unsigned_long_long_converter_impl(PyObject *module, unsigned long long a,
843 : : unsigned long long b, unsigned long long c);
844 : :
845 : : static PyObject *
846 : 0 : unsigned_long_long_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
847 : : {
848 : 0 : PyObject *return_value = NULL;
849 : 0 : unsigned long long a = 12;
850 : 0 : unsigned long long b = 34;
851 : 0 : unsigned long long c = 56;
852 : :
853 [ # # # # : 0 : if (!_PyArg_CheckPositional("unsigned_long_long_converter", nargs, 0, 3)) {
# # ]
854 : 0 : goto exit;
855 : : }
856 [ # # ]: 0 : if (nargs < 1) {
857 : 0 : goto skip_optional;
858 : : }
859 [ # # ]: 0 : if (!_PyLong_UnsignedLongLong_Converter(args[0], &a)) {
860 : 0 : goto exit;
861 : : }
862 [ # # ]: 0 : if (nargs < 2) {
863 : 0 : goto skip_optional;
864 : : }
865 [ # # ]: 0 : if (!_PyLong_UnsignedLongLong_Converter(args[1], &b)) {
866 : 0 : goto exit;
867 : : }
868 [ # # ]: 0 : if (nargs < 3) {
869 : 0 : goto skip_optional;
870 : : }
871 [ # # ]: 0 : if (!PyLong_Check(args[2])) {
872 : 0 : _PyArg_BadArgument("unsigned_long_long_converter", "argument 3", "int", args[2]);
873 : 0 : goto exit;
874 : : }
875 : 0 : c = PyLong_AsUnsignedLongLongMask(args[2]);
876 : 0 : skip_optional:
877 : 0 : return_value = unsigned_long_long_converter_impl(module, a, b, c);
878 : :
879 : 0 : exit:
880 : 0 : return return_value;
881 : : }
882 : :
883 : : PyDoc_STRVAR(py_ssize_t_converter__doc__,
884 : : "py_ssize_t_converter($module, a=12, b=34, c=56, /)\n"
885 : : "--\n"
886 : : "\n");
887 : :
888 : : #define PY_SSIZE_T_CONVERTER_METHODDEF \
889 : : {"py_ssize_t_converter", _PyCFunction_CAST(py_ssize_t_converter), METH_FASTCALL, py_ssize_t_converter__doc__},
890 : :
891 : : static PyObject *
892 : : py_ssize_t_converter_impl(PyObject *module, Py_ssize_t a, Py_ssize_t b,
893 : : Py_ssize_t c);
894 : :
895 : : static PyObject *
896 : 0 : py_ssize_t_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
897 : : {
898 : 0 : PyObject *return_value = NULL;
899 : 0 : Py_ssize_t a = 12;
900 : 0 : Py_ssize_t b = 34;
901 : 0 : Py_ssize_t c = 56;
902 : :
903 [ # # # # : 0 : if (!_PyArg_CheckPositional("py_ssize_t_converter", nargs, 0, 3)) {
# # ]
904 : 0 : goto exit;
905 : : }
906 [ # # ]: 0 : if (nargs < 1) {
907 : 0 : goto skip_optional;
908 : : }
909 : : {
910 : 0 : Py_ssize_t ival = -1;
911 : 0 : PyObject *iobj = _PyNumber_Index(args[0]);
912 [ # # ]: 0 : if (iobj != NULL) {
913 : 0 : ival = PyLong_AsSsize_t(iobj);
914 : 0 : Py_DECREF(iobj);
915 : : }
916 [ # # # # ]: 0 : if (ival == -1 && PyErr_Occurred()) {
917 : 0 : goto exit;
918 : : }
919 : 0 : a = ival;
920 : : }
921 [ # # ]: 0 : if (nargs < 2) {
922 : 0 : goto skip_optional;
923 : : }
924 : : {
925 : 0 : Py_ssize_t ival = -1;
926 : 0 : PyObject *iobj = _PyNumber_Index(args[1]);
927 [ # # ]: 0 : if (iobj != NULL) {
928 : 0 : ival = PyLong_AsSsize_t(iobj);
929 : 0 : Py_DECREF(iobj);
930 : : }
931 [ # # # # ]: 0 : if (ival == -1 && PyErr_Occurred()) {
932 : 0 : goto exit;
933 : : }
934 : 0 : b = ival;
935 : : }
936 [ # # ]: 0 : if (nargs < 3) {
937 : 0 : goto skip_optional;
938 : : }
939 [ # # ]: 0 : if (!_Py_convert_optional_to_ssize_t(args[2], &c)) {
940 : 0 : goto exit;
941 : : }
942 : 0 : skip_optional:
943 : 0 : return_value = py_ssize_t_converter_impl(module, a, b, c);
944 : :
945 : 0 : exit:
946 : 0 : return return_value;
947 : : }
948 : :
949 : : PyDoc_STRVAR(slice_index_converter__doc__,
950 : : "slice_index_converter($module, a=12, b=34, c=56, /)\n"
951 : : "--\n"
952 : : "\n");
953 : :
954 : : #define SLICE_INDEX_CONVERTER_METHODDEF \
955 : : {"slice_index_converter", _PyCFunction_CAST(slice_index_converter), METH_FASTCALL, slice_index_converter__doc__},
956 : :
957 : : static PyObject *
958 : : slice_index_converter_impl(PyObject *module, Py_ssize_t a, Py_ssize_t b,
959 : : Py_ssize_t c);
960 : :
961 : : static PyObject *
962 : 0 : slice_index_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
963 : : {
964 : 0 : PyObject *return_value = NULL;
965 : 0 : Py_ssize_t a = 12;
966 : 0 : Py_ssize_t b = 34;
967 : 0 : Py_ssize_t c = 56;
968 : :
969 [ # # # # : 0 : if (!_PyArg_CheckPositional("slice_index_converter", nargs, 0, 3)) {
# # ]
970 : 0 : goto exit;
971 : : }
972 [ # # ]: 0 : if (nargs < 1) {
973 : 0 : goto skip_optional;
974 : : }
975 [ # # ]: 0 : if (!_PyEval_SliceIndex(args[0], &a)) {
976 : 0 : goto exit;
977 : : }
978 [ # # ]: 0 : if (nargs < 2) {
979 : 0 : goto skip_optional;
980 : : }
981 [ # # ]: 0 : if (!_PyEval_SliceIndexNotNone(args[1], &b)) {
982 : 0 : goto exit;
983 : : }
984 [ # # ]: 0 : if (nargs < 3) {
985 : 0 : goto skip_optional;
986 : : }
987 [ # # ]: 0 : if (!_PyEval_SliceIndex(args[2], &c)) {
988 : 0 : goto exit;
989 : : }
990 : 0 : skip_optional:
991 : 0 : return_value = slice_index_converter_impl(module, a, b, c);
992 : :
993 : 0 : exit:
994 : 0 : return return_value;
995 : : }
996 : :
997 : : PyDoc_STRVAR(size_t_converter__doc__,
998 : : "size_t_converter($module, a=12, /)\n"
999 : : "--\n"
1000 : : "\n");
1001 : :
1002 : : #define SIZE_T_CONVERTER_METHODDEF \
1003 : : {"size_t_converter", _PyCFunction_CAST(size_t_converter), METH_FASTCALL, size_t_converter__doc__},
1004 : :
1005 : : static PyObject *
1006 : : size_t_converter_impl(PyObject *module, size_t a);
1007 : :
1008 : : static PyObject *
1009 : 0 : size_t_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1010 : : {
1011 : 0 : PyObject *return_value = NULL;
1012 : 0 : size_t a = 12;
1013 : :
1014 [ # # # # : 0 : if (!_PyArg_CheckPositional("size_t_converter", nargs, 0, 1)) {
# # ]
1015 : 0 : goto exit;
1016 : : }
1017 [ # # ]: 0 : if (nargs < 1) {
1018 : 0 : goto skip_optional;
1019 : : }
1020 [ # # ]: 0 : if (!_PyLong_Size_t_Converter(args[0], &a)) {
1021 : 0 : goto exit;
1022 : : }
1023 : 0 : skip_optional:
1024 : 0 : return_value = size_t_converter_impl(module, a);
1025 : :
1026 : 0 : exit:
1027 : 0 : return return_value;
1028 : : }
1029 : :
1030 : : PyDoc_STRVAR(float_converter__doc__,
1031 : : "float_converter($module, a=12.5, /)\n"
1032 : : "--\n"
1033 : : "\n");
1034 : :
1035 : : #define FLOAT_CONVERTER_METHODDEF \
1036 : : {"float_converter", _PyCFunction_CAST(float_converter), METH_FASTCALL, float_converter__doc__},
1037 : :
1038 : : static PyObject *
1039 : : float_converter_impl(PyObject *module, float a);
1040 : :
1041 : : static PyObject *
1042 : 0 : float_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1043 : : {
1044 : 0 : PyObject *return_value = NULL;
1045 : 0 : float a = 12.5;
1046 : :
1047 [ # # # # : 0 : if (!_PyArg_CheckPositional("float_converter", nargs, 0, 1)) {
# # ]
1048 : 0 : goto exit;
1049 : : }
1050 [ # # ]: 0 : if (nargs < 1) {
1051 : 0 : goto skip_optional;
1052 : : }
1053 [ # # ]: 0 : if (PyFloat_CheckExact(args[0])) {
1054 : 0 : a = (float) (PyFloat_AS_DOUBLE(args[0]));
1055 : : }
1056 : : else
1057 : : {
1058 : 0 : a = (float) PyFloat_AsDouble(args[0]);
1059 [ # # # # ]: 0 : if (a == -1.0 && PyErr_Occurred()) {
1060 : 0 : goto exit;
1061 : : }
1062 : : }
1063 : 0 : skip_optional:
1064 : 0 : return_value = float_converter_impl(module, a);
1065 : :
1066 : 0 : exit:
1067 : 0 : return return_value;
1068 : : }
1069 : :
1070 : : PyDoc_STRVAR(double_converter__doc__,
1071 : : "double_converter($module, a=12.5, /)\n"
1072 : : "--\n"
1073 : : "\n");
1074 : :
1075 : : #define DOUBLE_CONVERTER_METHODDEF \
1076 : : {"double_converter", _PyCFunction_CAST(double_converter), METH_FASTCALL, double_converter__doc__},
1077 : :
1078 : : static PyObject *
1079 : : double_converter_impl(PyObject *module, double a);
1080 : :
1081 : : static PyObject *
1082 : 0 : double_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1083 : : {
1084 : 0 : PyObject *return_value = NULL;
1085 : 0 : double a = 12.5;
1086 : :
1087 [ # # # # : 0 : if (!_PyArg_CheckPositional("double_converter", nargs, 0, 1)) {
# # ]
1088 : 0 : goto exit;
1089 : : }
1090 [ # # ]: 0 : if (nargs < 1) {
1091 : 0 : goto skip_optional;
1092 : : }
1093 [ # # ]: 0 : if (PyFloat_CheckExact(args[0])) {
1094 : 0 : a = PyFloat_AS_DOUBLE(args[0]);
1095 : : }
1096 : : else
1097 : : {
1098 : 0 : a = PyFloat_AsDouble(args[0]);
1099 [ # # # # ]: 0 : if (a == -1.0 && PyErr_Occurred()) {
1100 : 0 : goto exit;
1101 : : }
1102 : : }
1103 : 0 : skip_optional:
1104 : 0 : return_value = double_converter_impl(module, a);
1105 : :
1106 : 0 : exit:
1107 : 0 : return return_value;
1108 : : }
1109 : :
1110 : : PyDoc_STRVAR(py_complex_converter__doc__,
1111 : : "py_complex_converter($module, a, /)\n"
1112 : : "--\n"
1113 : : "\n");
1114 : :
1115 : : #define PY_COMPLEX_CONVERTER_METHODDEF \
1116 : : {"py_complex_converter", (PyCFunction)py_complex_converter, METH_O, py_complex_converter__doc__},
1117 : :
1118 : : static PyObject *
1119 : : py_complex_converter_impl(PyObject *module, Py_complex a);
1120 : :
1121 : : static PyObject *
1122 : 0 : py_complex_converter(PyObject *module, PyObject *arg)
1123 : : {
1124 : 0 : PyObject *return_value = NULL;
1125 : : Py_complex a;
1126 : :
1127 : 0 : a = PyComplex_AsCComplex(arg);
1128 [ # # ]: 0 : if (PyErr_Occurred()) {
1129 : 0 : goto exit;
1130 : : }
1131 : 0 : return_value = py_complex_converter_impl(module, a);
1132 : :
1133 : 0 : exit:
1134 : 0 : return return_value;
1135 : : }
1136 : :
1137 : : PyDoc_STRVAR(str_converter__doc__,
1138 : : "str_converter($module, a=\'a\', b=\'b\', c=\'c\', /)\n"
1139 : : "--\n"
1140 : : "\n");
1141 : :
1142 : : #define STR_CONVERTER_METHODDEF \
1143 : : {"str_converter", _PyCFunction_CAST(str_converter), METH_FASTCALL, str_converter__doc__},
1144 : :
1145 : : static PyObject *
1146 : : str_converter_impl(PyObject *module, const char *a, const char *b,
1147 : : const char *c, Py_ssize_t c_length);
1148 : :
1149 : : static PyObject *
1150 : 0 : str_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1151 : : {
1152 : 0 : PyObject *return_value = NULL;
1153 : 0 : const char *a = "a";
1154 : 0 : const char *b = "b";
1155 : 0 : const char *c = "c";
1156 : : Py_ssize_t c_length;
1157 : :
1158 [ # # ]: 0 : if (!_PyArg_ParseStack(args, nargs, "|sys#:str_converter",
1159 : : &a, &b, &c, &c_length)) {
1160 : 0 : goto exit;
1161 : : }
1162 : 0 : return_value = str_converter_impl(module, a, b, c, c_length);
1163 : :
1164 : 0 : exit:
1165 : 0 : return return_value;
1166 : : }
1167 : :
1168 : : PyDoc_STRVAR(str_converter_encoding__doc__,
1169 : : "str_converter_encoding($module, a, b, c, /)\n"
1170 : : "--\n"
1171 : : "\n");
1172 : :
1173 : : #define STR_CONVERTER_ENCODING_METHODDEF \
1174 : : {"str_converter_encoding", _PyCFunction_CAST(str_converter_encoding), METH_FASTCALL, str_converter_encoding__doc__},
1175 : :
1176 : : static PyObject *
1177 : : str_converter_encoding_impl(PyObject *module, char *a, char *b, char *c,
1178 : : Py_ssize_t c_length);
1179 : :
1180 : : static PyObject *
1181 : 0 : str_converter_encoding(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1182 : : {
1183 : 0 : PyObject *return_value = NULL;
1184 : 0 : char *a = NULL;
1185 : 0 : char *b = NULL;
1186 : 0 : char *c = NULL;
1187 : : Py_ssize_t c_length;
1188 : :
1189 [ # # ]: 0 : if (!_PyArg_ParseStack(args, nargs, "esetet#:str_converter_encoding",
1190 : : "idna", &a, "idna", &b, "idna", &c, &c_length)) {
1191 : 0 : goto exit;
1192 : : }
1193 : 0 : return_value = str_converter_encoding_impl(module, a, b, c, c_length);
1194 : : /* Post parse cleanup for a */
1195 : 0 : PyMem_FREE(a);
1196 : : /* Post parse cleanup for b */
1197 : 0 : PyMem_FREE(b);
1198 : : /* Post parse cleanup for c */
1199 : 0 : PyMem_FREE(c);
1200 : :
1201 : 0 : exit:
1202 : 0 : return return_value;
1203 : : }
1204 : :
1205 : : PyDoc_STRVAR(py_buffer_converter__doc__,
1206 : : "py_buffer_converter($module, a, b, /)\n"
1207 : : "--\n"
1208 : : "\n");
1209 : :
1210 : : #define PY_BUFFER_CONVERTER_METHODDEF \
1211 : : {"py_buffer_converter", _PyCFunction_CAST(py_buffer_converter), METH_FASTCALL, py_buffer_converter__doc__},
1212 : :
1213 : : static PyObject *
1214 : : py_buffer_converter_impl(PyObject *module, Py_buffer *a, Py_buffer *b);
1215 : :
1216 : : static PyObject *
1217 : 0 : py_buffer_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1218 : : {
1219 : 0 : PyObject *return_value = NULL;
1220 : 0 : Py_buffer a = {NULL, NULL};
1221 : 0 : Py_buffer b = {NULL, NULL};
1222 : :
1223 [ # # ]: 0 : if (!_PyArg_ParseStack(args, nargs, "z*w*:py_buffer_converter",
1224 : : &a, &b)) {
1225 : 0 : goto exit;
1226 : : }
1227 : 0 : return_value = py_buffer_converter_impl(module, &a, &b);
1228 : :
1229 : 0 : exit:
1230 : : /* Cleanup for a */
1231 [ # # ]: 0 : if (a.obj) {
1232 : 0 : PyBuffer_Release(&a);
1233 : : }
1234 : : /* Cleanup for b */
1235 [ # # ]: 0 : if (b.obj) {
1236 : 0 : PyBuffer_Release(&b);
1237 : : }
1238 : :
1239 : 0 : return return_value;
1240 : : }
1241 : :
1242 : : PyDoc_STRVAR(keywords__doc__,
1243 : : "keywords($module, /, a, b)\n"
1244 : : "--\n"
1245 : : "\n");
1246 : :
1247 : : #define KEYWORDS_METHODDEF \
1248 : : {"keywords", _PyCFunction_CAST(keywords), METH_FASTCALL|METH_KEYWORDS, keywords__doc__},
1249 : :
1250 : : static PyObject *
1251 : : keywords_impl(PyObject *module, PyObject *a, PyObject *b);
1252 : :
1253 : : static PyObject *
1254 : 0 : keywords(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1255 : : {
1256 : 0 : PyObject *return_value = NULL;
1257 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1258 : :
1259 : : #define NUM_KEYWORDS 2
1260 : : static struct {
1261 : : PyGC_Head _this_is_not_used;
1262 : : PyObject_VAR_HEAD
1263 : : PyObject *ob_item[NUM_KEYWORDS];
1264 : : } _kwtuple = {
1265 : : .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1266 : : .ob_item = { &_Py_ID(a), &_Py_ID(b), },
1267 : : };
1268 : : #undef NUM_KEYWORDS
1269 : : #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1270 : :
1271 : : #else // !Py_BUILD_CORE
1272 : : # define KWTUPLE NULL
1273 : : #endif // !Py_BUILD_CORE
1274 : :
1275 : : static const char * const _keywords[] = {"a", "b", NULL};
1276 : : static _PyArg_Parser _parser = {
1277 : : .keywords = _keywords,
1278 : : .fname = "keywords",
1279 : : .kwtuple = KWTUPLE,
1280 : : };
1281 : : #undef KWTUPLE
1282 : : PyObject *argsbuf[2];
1283 : : PyObject *a;
1284 : : PyObject *b;
1285 : :
1286 [ # # # # : 0 : args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
# # # # ]
1287 [ # # ]: 0 : if (!args) {
1288 : 0 : goto exit;
1289 : : }
1290 : 0 : a = args[0];
1291 : 0 : b = args[1];
1292 : 0 : return_value = keywords_impl(module, a, b);
1293 : :
1294 : 0 : exit:
1295 : 0 : return return_value;
1296 : : }
1297 : :
1298 : : PyDoc_STRVAR(keywords_kwonly__doc__,
1299 : : "keywords_kwonly($module, /, a, *, b)\n"
1300 : : "--\n"
1301 : : "\n");
1302 : :
1303 : : #define KEYWORDS_KWONLY_METHODDEF \
1304 : : {"keywords_kwonly", _PyCFunction_CAST(keywords_kwonly), METH_FASTCALL|METH_KEYWORDS, keywords_kwonly__doc__},
1305 : :
1306 : : static PyObject *
1307 : : keywords_kwonly_impl(PyObject *module, PyObject *a, PyObject *b);
1308 : :
1309 : : static PyObject *
1310 : 0 : keywords_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1311 : : {
1312 : 0 : PyObject *return_value = NULL;
1313 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1314 : :
1315 : : #define NUM_KEYWORDS 2
1316 : : static struct {
1317 : : PyGC_Head _this_is_not_used;
1318 : : PyObject_VAR_HEAD
1319 : : PyObject *ob_item[NUM_KEYWORDS];
1320 : : } _kwtuple = {
1321 : : .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1322 : : .ob_item = { &_Py_ID(a), &_Py_ID(b), },
1323 : : };
1324 : : #undef NUM_KEYWORDS
1325 : : #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1326 : :
1327 : : #else // !Py_BUILD_CORE
1328 : : # define KWTUPLE NULL
1329 : : #endif // !Py_BUILD_CORE
1330 : :
1331 : : static const char * const _keywords[] = {"a", "b", NULL};
1332 : : static _PyArg_Parser _parser = {
1333 : : .keywords = _keywords,
1334 : : .fname = "keywords_kwonly",
1335 : : .kwtuple = KWTUPLE,
1336 : : };
1337 : : #undef KWTUPLE
1338 : : PyObject *argsbuf[2];
1339 : : PyObject *a;
1340 : : PyObject *b;
1341 : :
1342 : 0 : args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 1, argsbuf);
1343 [ # # ]: 0 : if (!args) {
1344 : 0 : goto exit;
1345 : : }
1346 : 0 : a = args[0];
1347 : 0 : b = args[1];
1348 : 0 : return_value = keywords_kwonly_impl(module, a, b);
1349 : :
1350 : 0 : exit:
1351 : 0 : return return_value;
1352 : : }
1353 : :
1354 : : PyDoc_STRVAR(keywords_opt__doc__,
1355 : : "keywords_opt($module, /, a, b=None, c=None)\n"
1356 : : "--\n"
1357 : : "\n");
1358 : :
1359 : : #define KEYWORDS_OPT_METHODDEF \
1360 : : {"keywords_opt", _PyCFunction_CAST(keywords_opt), METH_FASTCALL|METH_KEYWORDS, keywords_opt__doc__},
1361 : :
1362 : : static PyObject *
1363 : : keywords_opt_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c);
1364 : :
1365 : : static PyObject *
1366 : 0 : keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1367 : : {
1368 : 0 : PyObject *return_value = NULL;
1369 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1370 : :
1371 : : #define NUM_KEYWORDS 3
1372 : : static struct {
1373 : : PyGC_Head _this_is_not_used;
1374 : : PyObject_VAR_HEAD
1375 : : PyObject *ob_item[NUM_KEYWORDS];
1376 : : } _kwtuple = {
1377 : : .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1378 : : .ob_item = { &_Py_ID(a), &_Py_ID(b), &_Py_ID(c), },
1379 : : };
1380 : : #undef NUM_KEYWORDS
1381 : : #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1382 : :
1383 : : #else // !Py_BUILD_CORE
1384 : : # define KWTUPLE NULL
1385 : : #endif // !Py_BUILD_CORE
1386 : :
1387 : : static const char * const _keywords[] = {"a", "b", "c", NULL};
1388 : : static _PyArg_Parser _parser = {
1389 : : .keywords = _keywords,
1390 : : .fname = "keywords_opt",
1391 : : .kwtuple = KWTUPLE,
1392 : : };
1393 : : #undef KWTUPLE
1394 : : PyObject *argsbuf[3];
1395 [ # # ]: 0 : Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
1396 : : PyObject *a;
1397 : 0 : PyObject *b = Py_None;
1398 : 0 : PyObject *c = Py_None;
1399 : :
1400 [ # # # # : 0 : args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
# # # # ]
1401 [ # # ]: 0 : if (!args) {
1402 : 0 : goto exit;
1403 : : }
1404 : 0 : a = args[0];
1405 [ # # ]: 0 : if (!noptargs) {
1406 : 0 : goto skip_optional_pos;
1407 : : }
1408 [ # # ]: 0 : if (args[1]) {
1409 : 0 : b = args[1];
1410 [ # # ]: 0 : if (!--noptargs) {
1411 : 0 : goto skip_optional_pos;
1412 : : }
1413 : : }
1414 : 0 : c = args[2];
1415 : 0 : skip_optional_pos:
1416 : 0 : return_value = keywords_opt_impl(module, a, b, c);
1417 : :
1418 : 0 : exit:
1419 : 0 : return return_value;
1420 : : }
1421 : :
1422 : : PyDoc_STRVAR(keywords_opt_kwonly__doc__,
1423 : : "keywords_opt_kwonly($module, /, a, b=None, *, c=None, d=None)\n"
1424 : : "--\n"
1425 : : "\n");
1426 : :
1427 : : #define KEYWORDS_OPT_KWONLY_METHODDEF \
1428 : : {"keywords_opt_kwonly", _PyCFunction_CAST(keywords_opt_kwonly), METH_FASTCALL|METH_KEYWORDS, keywords_opt_kwonly__doc__},
1429 : :
1430 : : static PyObject *
1431 : : keywords_opt_kwonly_impl(PyObject *module, PyObject *a, PyObject *b,
1432 : : PyObject *c, PyObject *d);
1433 : :
1434 : : static PyObject *
1435 : 0 : keywords_opt_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1436 : : {
1437 : 0 : PyObject *return_value = NULL;
1438 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1439 : :
1440 : : #define NUM_KEYWORDS 4
1441 : : static struct {
1442 : : PyGC_Head _this_is_not_used;
1443 : : PyObject_VAR_HEAD
1444 : : PyObject *ob_item[NUM_KEYWORDS];
1445 : : } _kwtuple = {
1446 : : .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1447 : : .ob_item = { &_Py_ID(a), &_Py_ID(b), &_Py_ID(c), &_Py_ID(d), },
1448 : : };
1449 : : #undef NUM_KEYWORDS
1450 : : #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1451 : :
1452 : : #else // !Py_BUILD_CORE
1453 : : # define KWTUPLE NULL
1454 : : #endif // !Py_BUILD_CORE
1455 : :
1456 : : static const char * const _keywords[] = {"a", "b", "c", "d", NULL};
1457 : : static _PyArg_Parser _parser = {
1458 : : .keywords = _keywords,
1459 : : .fname = "keywords_opt_kwonly",
1460 : : .kwtuple = KWTUPLE,
1461 : : };
1462 : : #undef KWTUPLE
1463 : : PyObject *argsbuf[4];
1464 [ # # ]: 0 : Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
1465 : : PyObject *a;
1466 : 0 : PyObject *b = Py_None;
1467 : 0 : PyObject *c = Py_None;
1468 : 0 : PyObject *d = Py_None;
1469 : :
1470 [ # # # # : 0 : args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
# # # # ]
1471 [ # # ]: 0 : if (!args) {
1472 : 0 : goto exit;
1473 : : }
1474 : 0 : a = args[0];
1475 [ # # ]: 0 : if (!noptargs) {
1476 : 0 : goto skip_optional_pos;
1477 : : }
1478 [ # # ]: 0 : if (args[1]) {
1479 : 0 : b = args[1];
1480 [ # # ]: 0 : if (!--noptargs) {
1481 : 0 : goto skip_optional_pos;
1482 : : }
1483 : : }
1484 : 0 : skip_optional_pos:
1485 [ # # ]: 0 : if (!noptargs) {
1486 : 0 : goto skip_optional_kwonly;
1487 : : }
1488 [ # # ]: 0 : if (args[2]) {
1489 : 0 : c = args[2];
1490 [ # # ]: 0 : if (!--noptargs) {
1491 : 0 : goto skip_optional_kwonly;
1492 : : }
1493 : : }
1494 : 0 : d = args[3];
1495 : 0 : skip_optional_kwonly:
1496 : 0 : return_value = keywords_opt_kwonly_impl(module, a, b, c, d);
1497 : :
1498 : 0 : exit:
1499 : 0 : return return_value;
1500 : : }
1501 : :
1502 : : PyDoc_STRVAR(keywords_kwonly_opt__doc__,
1503 : : "keywords_kwonly_opt($module, /, a, *, b=None, c=None)\n"
1504 : : "--\n"
1505 : : "\n");
1506 : :
1507 : : #define KEYWORDS_KWONLY_OPT_METHODDEF \
1508 : : {"keywords_kwonly_opt", _PyCFunction_CAST(keywords_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, keywords_kwonly_opt__doc__},
1509 : :
1510 : : static PyObject *
1511 : : keywords_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
1512 : : PyObject *c);
1513 : :
1514 : : static PyObject *
1515 : 0 : keywords_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1516 : : {
1517 : 0 : PyObject *return_value = NULL;
1518 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1519 : :
1520 : : #define NUM_KEYWORDS 3
1521 : : static struct {
1522 : : PyGC_Head _this_is_not_used;
1523 : : PyObject_VAR_HEAD
1524 : : PyObject *ob_item[NUM_KEYWORDS];
1525 : : } _kwtuple = {
1526 : : .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1527 : : .ob_item = { &_Py_ID(a), &_Py_ID(b), &_Py_ID(c), },
1528 : : };
1529 : : #undef NUM_KEYWORDS
1530 : : #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1531 : :
1532 : : #else // !Py_BUILD_CORE
1533 : : # define KWTUPLE NULL
1534 : : #endif // !Py_BUILD_CORE
1535 : :
1536 : : static const char * const _keywords[] = {"a", "b", "c", NULL};
1537 : : static _PyArg_Parser _parser = {
1538 : : .keywords = _keywords,
1539 : : .fname = "keywords_kwonly_opt",
1540 : : .kwtuple = KWTUPLE,
1541 : : };
1542 : : #undef KWTUPLE
1543 : : PyObject *argsbuf[3];
1544 [ # # ]: 0 : Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
1545 : : PyObject *a;
1546 : 0 : PyObject *b = Py_None;
1547 : 0 : PyObject *c = Py_None;
1548 : :
1549 [ # # # # : 0 : args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
# # # # ]
1550 [ # # ]: 0 : if (!args) {
1551 : 0 : goto exit;
1552 : : }
1553 : 0 : a = args[0];
1554 [ # # ]: 0 : if (!noptargs) {
1555 : 0 : goto skip_optional_kwonly;
1556 : : }
1557 [ # # ]: 0 : if (args[1]) {
1558 : 0 : b = args[1];
1559 [ # # ]: 0 : if (!--noptargs) {
1560 : 0 : goto skip_optional_kwonly;
1561 : : }
1562 : : }
1563 : 0 : c = args[2];
1564 : 0 : skip_optional_kwonly:
1565 : 0 : return_value = keywords_kwonly_opt_impl(module, a, b, c);
1566 : :
1567 : 0 : exit:
1568 : 0 : return return_value;
1569 : : }
1570 : :
1571 : : PyDoc_STRVAR(posonly_keywords__doc__,
1572 : : "posonly_keywords($module, a, /, b)\n"
1573 : : "--\n"
1574 : : "\n");
1575 : :
1576 : : #define POSONLY_KEYWORDS_METHODDEF \
1577 : : {"posonly_keywords", _PyCFunction_CAST(posonly_keywords), METH_FASTCALL|METH_KEYWORDS, posonly_keywords__doc__},
1578 : :
1579 : : static PyObject *
1580 : : posonly_keywords_impl(PyObject *module, PyObject *a, PyObject *b);
1581 : :
1582 : : static PyObject *
1583 : 0 : posonly_keywords(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1584 : : {
1585 : 0 : PyObject *return_value = NULL;
1586 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1587 : :
1588 : : #define NUM_KEYWORDS 1
1589 : : static struct {
1590 : : PyGC_Head _this_is_not_used;
1591 : : PyObject_VAR_HEAD
1592 : : PyObject *ob_item[NUM_KEYWORDS];
1593 : : } _kwtuple = {
1594 : : .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1595 : : .ob_item = { &_Py_ID(b), },
1596 : : };
1597 : : #undef NUM_KEYWORDS
1598 : : #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1599 : :
1600 : : #else // !Py_BUILD_CORE
1601 : : # define KWTUPLE NULL
1602 : : #endif // !Py_BUILD_CORE
1603 : :
1604 : : static const char * const _keywords[] = {"", "b", NULL};
1605 : : static _PyArg_Parser _parser = {
1606 : : .keywords = _keywords,
1607 : : .fname = "posonly_keywords",
1608 : : .kwtuple = KWTUPLE,
1609 : : };
1610 : : #undef KWTUPLE
1611 : : PyObject *argsbuf[2];
1612 : : PyObject *a;
1613 : : PyObject *b;
1614 : :
1615 [ # # # # : 0 : args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
# # # # ]
1616 [ # # ]: 0 : if (!args) {
1617 : 0 : goto exit;
1618 : : }
1619 : 0 : a = args[0];
1620 : 0 : b = args[1];
1621 : 0 : return_value = posonly_keywords_impl(module, a, b);
1622 : :
1623 : 0 : exit:
1624 : 0 : return return_value;
1625 : : }
1626 : :
1627 : : PyDoc_STRVAR(posonly_kwonly__doc__,
1628 : : "posonly_kwonly($module, a, /, *, b)\n"
1629 : : "--\n"
1630 : : "\n");
1631 : :
1632 : : #define POSONLY_KWONLY_METHODDEF \
1633 : : {"posonly_kwonly", _PyCFunction_CAST(posonly_kwonly), METH_FASTCALL|METH_KEYWORDS, posonly_kwonly__doc__},
1634 : :
1635 : : static PyObject *
1636 : : posonly_kwonly_impl(PyObject *module, PyObject *a, PyObject *b);
1637 : :
1638 : : static PyObject *
1639 : 0 : posonly_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1640 : : {
1641 : 0 : PyObject *return_value = NULL;
1642 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1643 : :
1644 : : #define NUM_KEYWORDS 1
1645 : : static struct {
1646 : : PyGC_Head _this_is_not_used;
1647 : : PyObject_VAR_HEAD
1648 : : PyObject *ob_item[NUM_KEYWORDS];
1649 : : } _kwtuple = {
1650 : : .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1651 : : .ob_item = { &_Py_ID(b), },
1652 : : };
1653 : : #undef NUM_KEYWORDS
1654 : : #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1655 : :
1656 : : #else // !Py_BUILD_CORE
1657 : : # define KWTUPLE NULL
1658 : : #endif // !Py_BUILD_CORE
1659 : :
1660 : : static const char * const _keywords[] = {"", "b", NULL};
1661 : : static _PyArg_Parser _parser = {
1662 : : .keywords = _keywords,
1663 : : .fname = "posonly_kwonly",
1664 : : .kwtuple = KWTUPLE,
1665 : : };
1666 : : #undef KWTUPLE
1667 : : PyObject *argsbuf[2];
1668 : : PyObject *a;
1669 : : PyObject *b;
1670 : :
1671 : 0 : args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 1, argsbuf);
1672 [ # # ]: 0 : if (!args) {
1673 : 0 : goto exit;
1674 : : }
1675 : 0 : a = args[0];
1676 : 0 : b = args[1];
1677 : 0 : return_value = posonly_kwonly_impl(module, a, b);
1678 : :
1679 : 0 : exit:
1680 : 0 : return return_value;
1681 : : }
1682 : :
1683 : : PyDoc_STRVAR(posonly_keywords_kwonly__doc__,
1684 : : "posonly_keywords_kwonly($module, a, /, b, *, c)\n"
1685 : : "--\n"
1686 : : "\n");
1687 : :
1688 : : #define POSONLY_KEYWORDS_KWONLY_METHODDEF \
1689 : : {"posonly_keywords_kwonly", _PyCFunction_CAST(posonly_keywords_kwonly), METH_FASTCALL|METH_KEYWORDS, posonly_keywords_kwonly__doc__},
1690 : :
1691 : : static PyObject *
1692 : : posonly_keywords_kwonly_impl(PyObject *module, PyObject *a, PyObject *b,
1693 : : PyObject *c);
1694 : :
1695 : : static PyObject *
1696 : 0 : posonly_keywords_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1697 : : {
1698 : 0 : PyObject *return_value = NULL;
1699 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1700 : :
1701 : : #define NUM_KEYWORDS 2
1702 : : static struct {
1703 : : PyGC_Head _this_is_not_used;
1704 : : PyObject_VAR_HEAD
1705 : : PyObject *ob_item[NUM_KEYWORDS];
1706 : : } _kwtuple = {
1707 : : .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1708 : : .ob_item = { &_Py_ID(b), &_Py_ID(c), },
1709 : : };
1710 : : #undef NUM_KEYWORDS
1711 : : #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1712 : :
1713 : : #else // !Py_BUILD_CORE
1714 : : # define KWTUPLE NULL
1715 : : #endif // !Py_BUILD_CORE
1716 : :
1717 : : static const char * const _keywords[] = {"", "b", "c", NULL};
1718 : : static _PyArg_Parser _parser = {
1719 : : .keywords = _keywords,
1720 : : .fname = "posonly_keywords_kwonly",
1721 : : .kwtuple = KWTUPLE,
1722 : : };
1723 : : #undef KWTUPLE
1724 : : PyObject *argsbuf[3];
1725 : : PyObject *a;
1726 : : PyObject *b;
1727 : : PyObject *c;
1728 : :
1729 : 0 : args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 1, argsbuf);
1730 [ # # ]: 0 : if (!args) {
1731 : 0 : goto exit;
1732 : : }
1733 : 0 : a = args[0];
1734 : 0 : b = args[1];
1735 : 0 : c = args[2];
1736 : 0 : return_value = posonly_keywords_kwonly_impl(module, a, b, c);
1737 : :
1738 : 0 : exit:
1739 : 0 : return return_value;
1740 : : }
1741 : :
1742 : : PyDoc_STRVAR(posonly_keywords_opt__doc__,
1743 : : "posonly_keywords_opt($module, a, /, b, c=None, d=None)\n"
1744 : : "--\n"
1745 : : "\n");
1746 : :
1747 : : #define POSONLY_KEYWORDS_OPT_METHODDEF \
1748 : : {"posonly_keywords_opt", _PyCFunction_CAST(posonly_keywords_opt), METH_FASTCALL|METH_KEYWORDS, posonly_keywords_opt__doc__},
1749 : :
1750 : : static PyObject *
1751 : : posonly_keywords_opt_impl(PyObject *module, PyObject *a, PyObject *b,
1752 : : PyObject *c, PyObject *d);
1753 : :
1754 : : static PyObject *
1755 : 0 : posonly_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1756 : : {
1757 : 0 : PyObject *return_value = NULL;
1758 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1759 : :
1760 : : #define NUM_KEYWORDS 3
1761 : : static struct {
1762 : : PyGC_Head _this_is_not_used;
1763 : : PyObject_VAR_HEAD
1764 : : PyObject *ob_item[NUM_KEYWORDS];
1765 : : } _kwtuple = {
1766 : : .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1767 : : .ob_item = { &_Py_ID(b), &_Py_ID(c), &_Py_ID(d), },
1768 : : };
1769 : : #undef NUM_KEYWORDS
1770 : : #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1771 : :
1772 : : #else // !Py_BUILD_CORE
1773 : : # define KWTUPLE NULL
1774 : : #endif // !Py_BUILD_CORE
1775 : :
1776 : : static const char * const _keywords[] = {"", "b", "c", "d", NULL};
1777 : : static _PyArg_Parser _parser = {
1778 : : .keywords = _keywords,
1779 : : .fname = "posonly_keywords_opt",
1780 : : .kwtuple = KWTUPLE,
1781 : : };
1782 : : #undef KWTUPLE
1783 : : PyObject *argsbuf[4];
1784 [ # # ]: 0 : Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
1785 : : PyObject *a;
1786 : : PyObject *b;
1787 : 0 : PyObject *c = Py_None;
1788 : 0 : PyObject *d = Py_None;
1789 : :
1790 [ # # # # : 0 : args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 4, 0, argsbuf);
# # # # ]
1791 [ # # ]: 0 : if (!args) {
1792 : 0 : goto exit;
1793 : : }
1794 : 0 : a = args[0];
1795 : 0 : b = args[1];
1796 [ # # ]: 0 : if (!noptargs) {
1797 : 0 : goto skip_optional_pos;
1798 : : }
1799 [ # # ]: 0 : if (args[2]) {
1800 : 0 : c = args[2];
1801 [ # # ]: 0 : if (!--noptargs) {
1802 : 0 : goto skip_optional_pos;
1803 : : }
1804 : : }
1805 : 0 : d = args[3];
1806 : 0 : skip_optional_pos:
1807 : 0 : return_value = posonly_keywords_opt_impl(module, a, b, c, d);
1808 : :
1809 : 0 : exit:
1810 : 0 : return return_value;
1811 : : }
1812 : :
1813 : : PyDoc_STRVAR(posonly_opt_keywords_opt__doc__,
1814 : : "posonly_opt_keywords_opt($module, a, b=None, /, c=None, d=None)\n"
1815 : : "--\n"
1816 : : "\n");
1817 : :
1818 : : #define POSONLY_OPT_KEYWORDS_OPT_METHODDEF \
1819 : : {"posonly_opt_keywords_opt", _PyCFunction_CAST(posonly_opt_keywords_opt), METH_FASTCALL|METH_KEYWORDS, posonly_opt_keywords_opt__doc__},
1820 : :
1821 : : static PyObject *
1822 : : posonly_opt_keywords_opt_impl(PyObject *module, PyObject *a, PyObject *b,
1823 : : PyObject *c, PyObject *d);
1824 : :
1825 : : static PyObject *
1826 : 0 : posonly_opt_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1827 : : {
1828 : 0 : PyObject *return_value = NULL;
1829 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1830 : :
1831 : : #define NUM_KEYWORDS 2
1832 : : static struct {
1833 : : PyGC_Head _this_is_not_used;
1834 : : PyObject_VAR_HEAD
1835 : : PyObject *ob_item[NUM_KEYWORDS];
1836 : : } _kwtuple = {
1837 : : .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1838 : : .ob_item = { &_Py_ID(c), &_Py_ID(d), },
1839 : : };
1840 : : #undef NUM_KEYWORDS
1841 : : #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1842 : :
1843 : : #else // !Py_BUILD_CORE
1844 : : # define KWTUPLE NULL
1845 : : #endif // !Py_BUILD_CORE
1846 : :
1847 : : static const char * const _keywords[] = {"", "", "c", "d", NULL};
1848 : : static _PyArg_Parser _parser = {
1849 : : .keywords = _keywords,
1850 : : .fname = "posonly_opt_keywords_opt",
1851 : : .kwtuple = KWTUPLE,
1852 : : };
1853 : : #undef KWTUPLE
1854 : : PyObject *argsbuf[4];
1855 [ # # ]: 0 : Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
1856 : : PyObject *a;
1857 : 0 : PyObject *b = Py_None;
1858 : 0 : PyObject *c = Py_None;
1859 : 0 : PyObject *d = Py_None;
1860 : :
1861 [ # # # # : 0 : args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 4, 0, argsbuf);
# # # # ]
1862 [ # # ]: 0 : if (!args) {
1863 : 0 : goto exit;
1864 : : }
1865 : 0 : a = args[0];
1866 [ # # ]: 0 : if (nargs < 2) {
1867 : 0 : goto skip_optional_posonly;
1868 : : }
1869 : 0 : noptargs--;
1870 : 0 : b = args[1];
1871 : 0 : skip_optional_posonly:
1872 [ # # ]: 0 : if (!noptargs) {
1873 : 0 : goto skip_optional_pos;
1874 : : }
1875 [ # # ]: 0 : if (args[2]) {
1876 : 0 : c = args[2];
1877 [ # # ]: 0 : if (!--noptargs) {
1878 : 0 : goto skip_optional_pos;
1879 : : }
1880 : : }
1881 : 0 : d = args[3];
1882 : 0 : skip_optional_pos:
1883 : 0 : return_value = posonly_opt_keywords_opt_impl(module, a, b, c, d);
1884 : :
1885 : 0 : exit:
1886 : 0 : return return_value;
1887 : : }
1888 : :
1889 : : PyDoc_STRVAR(posonly_kwonly_opt__doc__,
1890 : : "posonly_kwonly_opt($module, a, /, *, b, c=None, d=None)\n"
1891 : : "--\n"
1892 : : "\n");
1893 : :
1894 : : #define POSONLY_KWONLY_OPT_METHODDEF \
1895 : : {"posonly_kwonly_opt", _PyCFunction_CAST(posonly_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, posonly_kwonly_opt__doc__},
1896 : :
1897 : : static PyObject *
1898 : : posonly_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
1899 : : PyObject *c, PyObject *d);
1900 : :
1901 : : static PyObject *
1902 : 0 : posonly_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1903 : : {
1904 : 0 : PyObject *return_value = NULL;
1905 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1906 : :
1907 : : #define NUM_KEYWORDS 3
1908 : : static struct {
1909 : : PyGC_Head _this_is_not_used;
1910 : : PyObject_VAR_HEAD
1911 : : PyObject *ob_item[NUM_KEYWORDS];
1912 : : } _kwtuple = {
1913 : : .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1914 : : .ob_item = { &_Py_ID(b), &_Py_ID(c), &_Py_ID(d), },
1915 : : };
1916 : : #undef NUM_KEYWORDS
1917 : : #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1918 : :
1919 : : #else // !Py_BUILD_CORE
1920 : : # define KWTUPLE NULL
1921 : : #endif // !Py_BUILD_CORE
1922 : :
1923 : : static const char * const _keywords[] = {"", "b", "c", "d", NULL};
1924 : : static _PyArg_Parser _parser = {
1925 : : .keywords = _keywords,
1926 : : .fname = "posonly_kwonly_opt",
1927 : : .kwtuple = KWTUPLE,
1928 : : };
1929 : : #undef KWTUPLE
1930 : : PyObject *argsbuf[4];
1931 [ # # ]: 0 : Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
1932 : : PyObject *a;
1933 : : PyObject *b;
1934 : 0 : PyObject *c = Py_None;
1935 : 0 : PyObject *d = Py_None;
1936 : :
1937 : 0 : args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 1, argsbuf);
1938 [ # # ]: 0 : if (!args) {
1939 : 0 : goto exit;
1940 : : }
1941 : 0 : a = args[0];
1942 : 0 : b = args[1];
1943 [ # # ]: 0 : if (!noptargs) {
1944 : 0 : goto skip_optional_kwonly;
1945 : : }
1946 [ # # ]: 0 : if (args[2]) {
1947 : 0 : c = args[2];
1948 [ # # ]: 0 : if (!--noptargs) {
1949 : 0 : goto skip_optional_kwonly;
1950 : : }
1951 : : }
1952 : 0 : d = args[3];
1953 : 0 : skip_optional_kwonly:
1954 : 0 : return_value = posonly_kwonly_opt_impl(module, a, b, c, d);
1955 : :
1956 : 0 : exit:
1957 : 0 : return return_value;
1958 : : }
1959 : :
1960 : : PyDoc_STRVAR(posonly_opt_kwonly_opt__doc__,
1961 : : "posonly_opt_kwonly_opt($module, a, b=None, /, *, c=None, d=None)\n"
1962 : : "--\n"
1963 : : "\n");
1964 : :
1965 : : #define POSONLY_OPT_KWONLY_OPT_METHODDEF \
1966 : : {"posonly_opt_kwonly_opt", _PyCFunction_CAST(posonly_opt_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, posonly_opt_kwonly_opt__doc__},
1967 : :
1968 : : static PyObject *
1969 : : posonly_opt_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
1970 : : PyObject *c, PyObject *d);
1971 : :
1972 : : static PyObject *
1973 : 0 : posonly_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1974 : : {
1975 : 0 : PyObject *return_value = NULL;
1976 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1977 : :
1978 : : #define NUM_KEYWORDS 2
1979 : : static struct {
1980 : : PyGC_Head _this_is_not_used;
1981 : : PyObject_VAR_HEAD
1982 : : PyObject *ob_item[NUM_KEYWORDS];
1983 : : } _kwtuple = {
1984 : : .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1985 : : .ob_item = { &_Py_ID(c), &_Py_ID(d), },
1986 : : };
1987 : : #undef NUM_KEYWORDS
1988 : : #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1989 : :
1990 : : #else // !Py_BUILD_CORE
1991 : : # define KWTUPLE NULL
1992 : : #endif // !Py_BUILD_CORE
1993 : :
1994 : : static const char * const _keywords[] = {"", "", "c", "d", NULL};
1995 : : static _PyArg_Parser _parser = {
1996 : : .keywords = _keywords,
1997 : : .fname = "posonly_opt_kwonly_opt",
1998 : : .kwtuple = KWTUPLE,
1999 : : };
2000 : : #undef KWTUPLE
2001 : : PyObject *argsbuf[4];
2002 [ # # ]: 0 : Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
2003 : : PyObject *a;
2004 : 0 : PyObject *b = Py_None;
2005 : 0 : PyObject *c = Py_None;
2006 : 0 : PyObject *d = Py_None;
2007 : :
2008 [ # # # # : 0 : args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
# # # # ]
2009 [ # # ]: 0 : if (!args) {
2010 : 0 : goto exit;
2011 : : }
2012 : 0 : a = args[0];
2013 [ # # ]: 0 : if (nargs < 2) {
2014 : 0 : goto skip_optional_posonly;
2015 : : }
2016 : 0 : noptargs--;
2017 : 0 : b = args[1];
2018 : 0 : skip_optional_posonly:
2019 [ # # ]: 0 : if (!noptargs) {
2020 : 0 : goto skip_optional_kwonly;
2021 : : }
2022 [ # # ]: 0 : if (args[2]) {
2023 : 0 : c = args[2];
2024 [ # # ]: 0 : if (!--noptargs) {
2025 : 0 : goto skip_optional_kwonly;
2026 : : }
2027 : : }
2028 : 0 : d = args[3];
2029 : 0 : skip_optional_kwonly:
2030 : 0 : return_value = posonly_opt_kwonly_opt_impl(module, a, b, c, d);
2031 : :
2032 : 0 : exit:
2033 : 0 : return return_value;
2034 : : }
2035 : :
2036 : : PyDoc_STRVAR(posonly_keywords_kwonly_opt__doc__,
2037 : : "posonly_keywords_kwonly_opt($module, a, /, b, *, c, d=None, e=None)\n"
2038 : : "--\n"
2039 : : "\n");
2040 : :
2041 : : #define POSONLY_KEYWORDS_KWONLY_OPT_METHODDEF \
2042 : : {"posonly_keywords_kwonly_opt", _PyCFunction_CAST(posonly_keywords_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, posonly_keywords_kwonly_opt__doc__},
2043 : :
2044 : : static PyObject *
2045 : : posonly_keywords_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
2046 : : PyObject *c, PyObject *d, PyObject *e);
2047 : :
2048 : : static PyObject *
2049 : 0 : posonly_keywords_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2050 : : {
2051 : 0 : PyObject *return_value = NULL;
2052 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2053 : :
2054 : : #define NUM_KEYWORDS 4
2055 : : static struct {
2056 : : PyGC_Head _this_is_not_used;
2057 : : PyObject_VAR_HEAD
2058 : : PyObject *ob_item[NUM_KEYWORDS];
2059 : : } _kwtuple = {
2060 : : .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2061 : : .ob_item = { &_Py_ID(b), &_Py_ID(c), &_Py_ID(d), &_Py_ID(e), },
2062 : : };
2063 : : #undef NUM_KEYWORDS
2064 : : #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2065 : :
2066 : : #else // !Py_BUILD_CORE
2067 : : # define KWTUPLE NULL
2068 : : #endif // !Py_BUILD_CORE
2069 : :
2070 : : static const char * const _keywords[] = {"", "b", "c", "d", "e", NULL};
2071 : : static _PyArg_Parser _parser = {
2072 : : .keywords = _keywords,
2073 : : .fname = "posonly_keywords_kwonly_opt",
2074 : : .kwtuple = KWTUPLE,
2075 : : };
2076 : : #undef KWTUPLE
2077 : : PyObject *argsbuf[5];
2078 [ # # ]: 0 : Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 3;
2079 : : PyObject *a;
2080 : : PyObject *b;
2081 : : PyObject *c;
2082 : 0 : PyObject *d = Py_None;
2083 : 0 : PyObject *e = Py_None;
2084 : :
2085 : 0 : args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 1, argsbuf);
2086 [ # # ]: 0 : if (!args) {
2087 : 0 : goto exit;
2088 : : }
2089 : 0 : a = args[0];
2090 : 0 : b = args[1];
2091 : 0 : c = args[2];
2092 [ # # ]: 0 : if (!noptargs) {
2093 : 0 : goto skip_optional_kwonly;
2094 : : }
2095 [ # # ]: 0 : if (args[3]) {
2096 : 0 : d = args[3];
2097 [ # # ]: 0 : if (!--noptargs) {
2098 : 0 : goto skip_optional_kwonly;
2099 : : }
2100 : : }
2101 : 0 : e = args[4];
2102 : 0 : skip_optional_kwonly:
2103 : 0 : return_value = posonly_keywords_kwonly_opt_impl(module, a, b, c, d, e);
2104 : :
2105 : 0 : exit:
2106 : 0 : return return_value;
2107 : : }
2108 : :
2109 : : PyDoc_STRVAR(posonly_keywords_opt_kwonly_opt__doc__,
2110 : : "posonly_keywords_opt_kwonly_opt($module, a, /, b, c=None, *, d=None,\n"
2111 : : " e=None)\n"
2112 : : "--\n"
2113 : : "\n");
2114 : :
2115 : : #define POSONLY_KEYWORDS_OPT_KWONLY_OPT_METHODDEF \
2116 : : {"posonly_keywords_opt_kwonly_opt", _PyCFunction_CAST(posonly_keywords_opt_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, posonly_keywords_opt_kwonly_opt__doc__},
2117 : :
2118 : : static PyObject *
2119 : : posonly_keywords_opt_kwonly_opt_impl(PyObject *module, PyObject *a,
2120 : : PyObject *b, PyObject *c, PyObject *d,
2121 : : PyObject *e);
2122 : :
2123 : : static PyObject *
2124 : 0 : posonly_keywords_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2125 : : {
2126 : 0 : PyObject *return_value = NULL;
2127 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2128 : :
2129 : : #define NUM_KEYWORDS 4
2130 : : static struct {
2131 : : PyGC_Head _this_is_not_used;
2132 : : PyObject_VAR_HEAD
2133 : : PyObject *ob_item[NUM_KEYWORDS];
2134 : : } _kwtuple = {
2135 : : .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2136 : : .ob_item = { &_Py_ID(b), &_Py_ID(c), &_Py_ID(d), &_Py_ID(e), },
2137 : : };
2138 : : #undef NUM_KEYWORDS
2139 : : #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2140 : :
2141 : : #else // !Py_BUILD_CORE
2142 : : # define KWTUPLE NULL
2143 : : #endif // !Py_BUILD_CORE
2144 : :
2145 : : static const char * const _keywords[] = {"", "b", "c", "d", "e", NULL};
2146 : : static _PyArg_Parser _parser = {
2147 : : .keywords = _keywords,
2148 : : .fname = "posonly_keywords_opt_kwonly_opt",
2149 : : .kwtuple = KWTUPLE,
2150 : : };
2151 : : #undef KWTUPLE
2152 : : PyObject *argsbuf[5];
2153 [ # # ]: 0 : Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
2154 : : PyObject *a;
2155 : : PyObject *b;
2156 : 0 : PyObject *c = Py_None;
2157 : 0 : PyObject *d = Py_None;
2158 : 0 : PyObject *e = Py_None;
2159 : :
2160 [ # # # # : 0 : args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 3, 0, argsbuf);
# # # # ]
2161 [ # # ]: 0 : if (!args) {
2162 : 0 : goto exit;
2163 : : }
2164 : 0 : a = args[0];
2165 : 0 : b = args[1];
2166 [ # # ]: 0 : if (!noptargs) {
2167 : 0 : goto skip_optional_pos;
2168 : : }
2169 [ # # ]: 0 : if (args[2]) {
2170 : 0 : c = args[2];
2171 [ # # ]: 0 : if (!--noptargs) {
2172 : 0 : goto skip_optional_pos;
2173 : : }
2174 : : }
2175 : 0 : skip_optional_pos:
2176 [ # # ]: 0 : if (!noptargs) {
2177 : 0 : goto skip_optional_kwonly;
2178 : : }
2179 [ # # ]: 0 : if (args[3]) {
2180 : 0 : d = args[3];
2181 [ # # ]: 0 : if (!--noptargs) {
2182 : 0 : goto skip_optional_kwonly;
2183 : : }
2184 : : }
2185 : 0 : e = args[4];
2186 : 0 : skip_optional_kwonly:
2187 : 0 : return_value = posonly_keywords_opt_kwonly_opt_impl(module, a, b, c, d, e);
2188 : :
2189 : 0 : exit:
2190 : 0 : return return_value;
2191 : : }
2192 : :
2193 : : PyDoc_STRVAR(posonly_opt_keywords_opt_kwonly_opt__doc__,
2194 : : "posonly_opt_keywords_opt_kwonly_opt($module, a, b=None, /, c=None, *,\n"
2195 : : " d=None)\n"
2196 : : "--\n"
2197 : : "\n");
2198 : :
2199 : : #define POSONLY_OPT_KEYWORDS_OPT_KWONLY_OPT_METHODDEF \
2200 : : {"posonly_opt_keywords_opt_kwonly_opt", _PyCFunction_CAST(posonly_opt_keywords_opt_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, posonly_opt_keywords_opt_kwonly_opt__doc__},
2201 : :
2202 : : static PyObject *
2203 : : posonly_opt_keywords_opt_kwonly_opt_impl(PyObject *module, PyObject *a,
2204 : : PyObject *b, PyObject *c,
2205 : : PyObject *d);
2206 : :
2207 : : static PyObject *
2208 : 0 : posonly_opt_keywords_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2209 : : {
2210 : 0 : PyObject *return_value = NULL;
2211 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2212 : :
2213 : : #define NUM_KEYWORDS 2
2214 : : static struct {
2215 : : PyGC_Head _this_is_not_used;
2216 : : PyObject_VAR_HEAD
2217 : : PyObject *ob_item[NUM_KEYWORDS];
2218 : : } _kwtuple = {
2219 : : .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2220 : : .ob_item = { &_Py_ID(c), &_Py_ID(d), },
2221 : : };
2222 : : #undef NUM_KEYWORDS
2223 : : #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2224 : :
2225 : : #else // !Py_BUILD_CORE
2226 : : # define KWTUPLE NULL
2227 : : #endif // !Py_BUILD_CORE
2228 : :
2229 : : static const char * const _keywords[] = {"", "", "c", "d", NULL};
2230 : : static _PyArg_Parser _parser = {
2231 : : .keywords = _keywords,
2232 : : .fname = "posonly_opt_keywords_opt_kwonly_opt",
2233 : : .kwtuple = KWTUPLE,
2234 : : };
2235 : : #undef KWTUPLE
2236 : : PyObject *argsbuf[4];
2237 [ # # ]: 0 : Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
2238 : : PyObject *a;
2239 : 0 : PyObject *b = Py_None;
2240 : 0 : PyObject *c = Py_None;
2241 : 0 : PyObject *d = Py_None;
2242 : :
2243 [ # # # # : 0 : args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
# # # # ]
2244 [ # # ]: 0 : if (!args) {
2245 : 0 : goto exit;
2246 : : }
2247 : 0 : a = args[0];
2248 [ # # ]: 0 : if (nargs < 2) {
2249 : 0 : goto skip_optional_posonly;
2250 : : }
2251 : 0 : noptargs--;
2252 : 0 : b = args[1];
2253 : 0 : skip_optional_posonly:
2254 [ # # ]: 0 : if (!noptargs) {
2255 : 0 : goto skip_optional_pos;
2256 : : }
2257 [ # # ]: 0 : if (args[2]) {
2258 : 0 : c = args[2];
2259 [ # # ]: 0 : if (!--noptargs) {
2260 : 0 : goto skip_optional_pos;
2261 : : }
2262 : : }
2263 : 0 : skip_optional_pos:
2264 [ # # ]: 0 : if (!noptargs) {
2265 : 0 : goto skip_optional_kwonly;
2266 : : }
2267 : 0 : d = args[3];
2268 : 0 : skip_optional_kwonly:
2269 : 0 : return_value = posonly_opt_keywords_opt_kwonly_opt_impl(module, a, b, c, d);
2270 : :
2271 : 0 : exit:
2272 : 0 : return return_value;
2273 : : }
2274 : :
2275 : : PyDoc_STRVAR(keyword_only_parameter__doc__,
2276 : : "keyword_only_parameter($module, /, *, a)\n"
2277 : : "--\n"
2278 : : "\n");
2279 : :
2280 : : #define KEYWORD_ONLY_PARAMETER_METHODDEF \
2281 : : {"keyword_only_parameter", _PyCFunction_CAST(keyword_only_parameter), METH_FASTCALL|METH_KEYWORDS, keyword_only_parameter__doc__},
2282 : :
2283 : : static PyObject *
2284 : : keyword_only_parameter_impl(PyObject *module, PyObject *a);
2285 : :
2286 : : static PyObject *
2287 : 0 : keyword_only_parameter(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2288 : : {
2289 : 0 : PyObject *return_value = NULL;
2290 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2291 : :
2292 : : #define NUM_KEYWORDS 1
2293 : : static struct {
2294 : : PyGC_Head _this_is_not_used;
2295 : : PyObject_VAR_HEAD
2296 : : PyObject *ob_item[NUM_KEYWORDS];
2297 : : } _kwtuple = {
2298 : : .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2299 : : .ob_item = { &_Py_ID(a), },
2300 : : };
2301 : : #undef NUM_KEYWORDS
2302 : : #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2303 : :
2304 : : #else // !Py_BUILD_CORE
2305 : : # define KWTUPLE NULL
2306 : : #endif // !Py_BUILD_CORE
2307 : :
2308 : : static const char * const _keywords[] = {"a", NULL};
2309 : : static _PyArg_Parser _parser = {
2310 : : .keywords = _keywords,
2311 : : .fname = "keyword_only_parameter",
2312 : : .kwtuple = KWTUPLE,
2313 : : };
2314 : : #undef KWTUPLE
2315 : : PyObject *argsbuf[1];
2316 : : PyObject *a;
2317 : :
2318 : 0 : args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 0, 1, argsbuf);
2319 [ # # ]: 0 : if (!args) {
2320 : 0 : goto exit;
2321 : : }
2322 : 0 : a = args[0];
2323 : 0 : return_value = keyword_only_parameter_impl(module, a);
2324 : :
2325 : 0 : exit:
2326 : 0 : return return_value;
2327 : : }
2328 : :
2329 : : PyDoc_STRVAR(posonly_vararg__doc__,
2330 : : "posonly_vararg($module, a, /, b, *args)\n"
2331 : : "--\n"
2332 : : "\n");
2333 : :
2334 : : #define POSONLY_VARARG_METHODDEF \
2335 : : {"posonly_vararg", _PyCFunction_CAST(posonly_vararg), METH_FASTCALL|METH_KEYWORDS, posonly_vararg__doc__},
2336 : :
2337 : : static PyObject *
2338 : : posonly_vararg_impl(PyObject *module, PyObject *a, PyObject *b,
2339 : : PyObject *args);
2340 : :
2341 : : static PyObject *
2342 : 0 : posonly_vararg(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2343 : : {
2344 : 0 : PyObject *return_value = NULL;
2345 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2346 : :
2347 : : #define NUM_KEYWORDS 1
2348 : : static struct {
2349 : : PyGC_Head _this_is_not_used;
2350 : : PyObject_VAR_HEAD
2351 : : PyObject *ob_item[NUM_KEYWORDS];
2352 : : } _kwtuple = {
2353 : : .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2354 : : .ob_item = { &_Py_ID(b), },
2355 : : };
2356 : : #undef NUM_KEYWORDS
2357 : : #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2358 : :
2359 : : #else // !Py_BUILD_CORE
2360 : : # define KWTUPLE NULL
2361 : : #endif // !Py_BUILD_CORE
2362 : :
2363 : : static const char * const _keywords[] = {"", "b", NULL};
2364 : : static _PyArg_Parser _parser = {
2365 : : .keywords = _keywords,
2366 : : .fname = "posonly_vararg",
2367 : : .kwtuple = KWTUPLE,
2368 : : };
2369 : : #undef KWTUPLE
2370 : : PyObject *argsbuf[3];
2371 : : PyObject *a;
2372 : : PyObject *b;
2373 : 0 : PyObject *__clinic_args = NULL;
2374 : :
2375 : 0 : args = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, 2, argsbuf);
2376 [ # # ]: 0 : if (!args) {
2377 : 0 : goto exit;
2378 : : }
2379 : 0 : a = args[0];
2380 : 0 : b = args[1];
2381 : 0 : __clinic_args = args[2];
2382 : 0 : return_value = posonly_vararg_impl(module, a, b, __clinic_args);
2383 : :
2384 : 0 : exit:
2385 : 0 : Py_XDECREF(__clinic_args);
2386 : 0 : return return_value;
2387 : : }
2388 : :
2389 : : PyDoc_STRVAR(vararg_and_posonly__doc__,
2390 : : "vararg_and_posonly($module, a, /, *args)\n"
2391 : : "--\n"
2392 : : "\n");
2393 : :
2394 : : #define VARARG_AND_POSONLY_METHODDEF \
2395 : : {"vararg_and_posonly", _PyCFunction_CAST(vararg_and_posonly), METH_FASTCALL, vararg_and_posonly__doc__},
2396 : :
2397 : : static PyObject *
2398 : : vararg_and_posonly_impl(PyObject *module, PyObject *a, PyObject *args);
2399 : :
2400 : : static PyObject *
2401 : 0 : vararg_and_posonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
2402 : : {
2403 : 0 : PyObject *return_value = NULL;
2404 : : PyObject *a;
2405 : 0 : PyObject *__clinic_args = NULL;
2406 : :
2407 [ # # ]: 0 : if (!_PyArg_CheckPositional("vararg_and_posonly", nargs, 1, PY_SSIZE_T_MAX)) {
2408 : 0 : goto exit;
2409 : : }
2410 : 0 : a = args[0];
2411 : 0 : __clinic_args = PyTuple_New(nargs - 1);
2412 [ # # ]: 0 : if (!__clinic_args) {
2413 : 0 : goto exit;
2414 : : }
2415 [ # # ]: 0 : for (Py_ssize_t i = 0; i < nargs - 1; ++i) {
2416 : 0 : PyTuple_SET_ITEM(__clinic_args, i, Py_NewRef(args[1 + i]));
2417 : : }
2418 : 0 : return_value = vararg_and_posonly_impl(module, a, __clinic_args);
2419 : :
2420 : 0 : exit:
2421 : 0 : Py_XDECREF(__clinic_args);
2422 : 0 : return return_value;
2423 : : }
2424 : :
2425 : : PyDoc_STRVAR(vararg__doc__,
2426 : : "vararg($module, /, a, *args)\n"
2427 : : "--\n"
2428 : : "\n");
2429 : :
2430 : : #define VARARG_METHODDEF \
2431 : : {"vararg", _PyCFunction_CAST(vararg), METH_FASTCALL|METH_KEYWORDS, vararg__doc__},
2432 : :
2433 : : static PyObject *
2434 : : vararg_impl(PyObject *module, PyObject *a, PyObject *args);
2435 : :
2436 : : static PyObject *
2437 : 0 : vararg(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2438 : : {
2439 : 0 : PyObject *return_value = NULL;
2440 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2441 : :
2442 : : #define NUM_KEYWORDS 1
2443 : : static struct {
2444 : : PyGC_Head _this_is_not_used;
2445 : : PyObject_VAR_HEAD
2446 : : PyObject *ob_item[NUM_KEYWORDS];
2447 : : } _kwtuple = {
2448 : : .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2449 : : .ob_item = { &_Py_ID(a), },
2450 : : };
2451 : : #undef NUM_KEYWORDS
2452 : : #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2453 : :
2454 : : #else // !Py_BUILD_CORE
2455 : : # define KWTUPLE NULL
2456 : : #endif // !Py_BUILD_CORE
2457 : :
2458 : : static const char * const _keywords[] = {"a", NULL};
2459 : : static _PyArg_Parser _parser = {
2460 : : .keywords = _keywords,
2461 : : .fname = "vararg",
2462 : : .kwtuple = KWTUPLE,
2463 : : };
2464 : : #undef KWTUPLE
2465 : : PyObject *argsbuf[2];
2466 : : PyObject *a;
2467 : 0 : PyObject *__clinic_args = NULL;
2468 : :
2469 : 0 : args = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, 1, argsbuf);
2470 [ # # ]: 0 : if (!args) {
2471 : 0 : goto exit;
2472 : : }
2473 : 0 : a = args[0];
2474 : 0 : __clinic_args = args[1];
2475 : 0 : return_value = vararg_impl(module, a, __clinic_args);
2476 : :
2477 : 0 : exit:
2478 : 0 : Py_XDECREF(__clinic_args);
2479 : 0 : return return_value;
2480 : : }
2481 : :
2482 : : PyDoc_STRVAR(vararg_with_default__doc__,
2483 : : "vararg_with_default($module, /, a, *args, b=False)\n"
2484 : : "--\n"
2485 : : "\n");
2486 : :
2487 : : #define VARARG_WITH_DEFAULT_METHODDEF \
2488 : : {"vararg_with_default", _PyCFunction_CAST(vararg_with_default), METH_FASTCALL|METH_KEYWORDS, vararg_with_default__doc__},
2489 : :
2490 : : static PyObject *
2491 : : vararg_with_default_impl(PyObject *module, PyObject *a, PyObject *args,
2492 : : int b);
2493 : :
2494 : : static PyObject *
2495 : 0 : vararg_with_default(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2496 : : {
2497 : 0 : PyObject *return_value = NULL;
2498 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2499 : :
2500 : : #define NUM_KEYWORDS 2
2501 : : static struct {
2502 : : PyGC_Head _this_is_not_used;
2503 : : PyObject_VAR_HEAD
2504 : : PyObject *ob_item[NUM_KEYWORDS];
2505 : : } _kwtuple = {
2506 : : .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2507 : : .ob_item = { &_Py_ID(a), &_Py_ID(b), },
2508 : : };
2509 : : #undef NUM_KEYWORDS
2510 : : #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2511 : :
2512 : : #else // !Py_BUILD_CORE
2513 : : # define KWTUPLE NULL
2514 : : #endif // !Py_BUILD_CORE
2515 : :
2516 : : static const char * const _keywords[] = {"a", "b", NULL};
2517 : : static _PyArg_Parser _parser = {
2518 : : .keywords = _keywords,
2519 : : .fname = "vararg_with_default",
2520 : : .kwtuple = KWTUPLE,
2521 : : };
2522 : : #undef KWTUPLE
2523 : : PyObject *argsbuf[3];
2524 [ # # ]: 0 : Py_ssize_t noptargs = Py_MIN(nargs, 1) + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
2525 : : PyObject *a;
2526 : 0 : PyObject *__clinic_args = NULL;
2527 : 0 : int b = 0;
2528 : :
2529 : 0 : args = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, 1, argsbuf);
2530 [ # # ]: 0 : if (!args) {
2531 : 0 : goto exit;
2532 : : }
2533 : 0 : a = args[0];
2534 : 0 : __clinic_args = args[1];
2535 [ # # ]: 0 : if (!noptargs) {
2536 : 0 : goto skip_optional_kwonly;
2537 : : }
2538 : 0 : b = PyObject_IsTrue(args[2]);
2539 [ # # ]: 0 : if (b < 0) {
2540 : 0 : goto exit;
2541 : : }
2542 : 0 : skip_optional_kwonly:
2543 : 0 : return_value = vararg_with_default_impl(module, a, __clinic_args, b);
2544 : :
2545 : 0 : exit:
2546 : 0 : Py_XDECREF(__clinic_args);
2547 : 0 : return return_value;
2548 : : }
2549 : :
2550 : : PyDoc_STRVAR(vararg_with_only_defaults__doc__,
2551 : : "vararg_with_only_defaults($module, /, *args, b=None)\n"
2552 : : "--\n"
2553 : : "\n");
2554 : :
2555 : : #define VARARG_WITH_ONLY_DEFAULTS_METHODDEF \
2556 : : {"vararg_with_only_defaults", _PyCFunction_CAST(vararg_with_only_defaults), METH_FASTCALL|METH_KEYWORDS, vararg_with_only_defaults__doc__},
2557 : :
2558 : : static PyObject *
2559 : : vararg_with_only_defaults_impl(PyObject *module, PyObject *args, PyObject *b);
2560 : :
2561 : : static PyObject *
2562 : 0 : vararg_with_only_defaults(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2563 : : {
2564 : 0 : PyObject *return_value = NULL;
2565 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2566 : :
2567 : : #define NUM_KEYWORDS 1
2568 : : static struct {
2569 : : PyGC_Head _this_is_not_used;
2570 : : PyObject_VAR_HEAD
2571 : : PyObject *ob_item[NUM_KEYWORDS];
2572 : : } _kwtuple = {
2573 : : .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2574 : : .ob_item = { &_Py_ID(b), },
2575 : : };
2576 : : #undef NUM_KEYWORDS
2577 : : #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2578 : :
2579 : : #else // !Py_BUILD_CORE
2580 : : # define KWTUPLE NULL
2581 : : #endif // !Py_BUILD_CORE
2582 : :
2583 : : static const char * const _keywords[] = {"b", NULL};
2584 : : static _PyArg_Parser _parser = {
2585 : : .keywords = _keywords,
2586 : : .fname = "vararg_with_only_defaults",
2587 : : .kwtuple = KWTUPLE,
2588 : : };
2589 : : #undef KWTUPLE
2590 : : PyObject *argsbuf[2];
2591 [ # # ]: 0 : Py_ssize_t noptargs = 0 + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
2592 : 0 : PyObject *__clinic_args = NULL;
2593 : 0 : PyObject *b = Py_None;
2594 : :
2595 : 0 : args = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 0, 0, 0, 0, argsbuf);
2596 [ # # ]: 0 : if (!args) {
2597 : 0 : goto exit;
2598 : : }
2599 : 0 : __clinic_args = args[0];
2600 [ # # ]: 0 : if (!noptargs) {
2601 : 0 : goto skip_optional_kwonly;
2602 : : }
2603 : 0 : b = args[1];
2604 : 0 : skip_optional_kwonly:
2605 : 0 : return_value = vararg_with_only_defaults_impl(module, __clinic_args, b);
2606 : :
2607 : 0 : exit:
2608 : 0 : Py_XDECREF(__clinic_args);
2609 : 0 : return return_value;
2610 : : }
2611 : :
2612 : : PyDoc_STRVAR(gh_32092_oob__doc__,
2613 : : "gh_32092_oob($module, /, pos1, pos2, *varargs, kw1=None, kw2=None)\n"
2614 : : "--\n"
2615 : : "\n"
2616 : : "Proof-of-concept of GH-32092 OOB bug.");
2617 : :
2618 : : #define GH_32092_OOB_METHODDEF \
2619 : : {"gh_32092_oob", _PyCFunction_CAST(gh_32092_oob), METH_FASTCALL|METH_KEYWORDS, gh_32092_oob__doc__},
2620 : :
2621 : : static PyObject *
2622 : : gh_32092_oob_impl(PyObject *module, PyObject *pos1, PyObject *pos2,
2623 : : PyObject *varargs, PyObject *kw1, PyObject *kw2);
2624 : :
2625 : : static PyObject *
2626 : 0 : gh_32092_oob(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2627 : : {
2628 : 0 : PyObject *return_value = NULL;
2629 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2630 : :
2631 : : #define NUM_KEYWORDS 4
2632 : : static struct {
2633 : : PyGC_Head _this_is_not_used;
2634 : : PyObject_VAR_HEAD
2635 : : PyObject *ob_item[NUM_KEYWORDS];
2636 : : } _kwtuple = {
2637 : : .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2638 : : .ob_item = { &_Py_ID(pos1), &_Py_ID(pos2), &_Py_ID(kw1), &_Py_ID(kw2), },
2639 : : };
2640 : : #undef NUM_KEYWORDS
2641 : : #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2642 : :
2643 : : #else // !Py_BUILD_CORE
2644 : : # define KWTUPLE NULL
2645 : : #endif // !Py_BUILD_CORE
2646 : :
2647 : : static const char * const _keywords[] = {"pos1", "pos2", "kw1", "kw2", NULL};
2648 : : static _PyArg_Parser _parser = {
2649 : : .keywords = _keywords,
2650 : : .fname = "gh_32092_oob",
2651 : : .kwtuple = KWTUPLE,
2652 : : };
2653 : : #undef KWTUPLE
2654 : : PyObject *argsbuf[5];
2655 [ # # ]: 0 : Py_ssize_t noptargs = Py_MIN(nargs, 2) + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
2656 : : PyObject *pos1;
2657 : : PyObject *pos2;
2658 : 0 : PyObject *varargs = NULL;
2659 : 0 : PyObject *kw1 = Py_None;
2660 : 0 : PyObject *kw2 = Py_None;
2661 : :
2662 : 0 : args = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, 2, argsbuf);
2663 [ # # ]: 0 : if (!args) {
2664 : 0 : goto exit;
2665 : : }
2666 : 0 : pos1 = args[0];
2667 : 0 : pos2 = args[1];
2668 : 0 : varargs = args[2];
2669 [ # # ]: 0 : if (!noptargs) {
2670 : 0 : goto skip_optional_kwonly;
2671 : : }
2672 [ # # ]: 0 : if (args[3]) {
2673 : 0 : kw1 = args[3];
2674 [ # # ]: 0 : if (!--noptargs) {
2675 : 0 : goto skip_optional_kwonly;
2676 : : }
2677 : : }
2678 : 0 : kw2 = args[4];
2679 : 0 : skip_optional_kwonly:
2680 : 0 : return_value = gh_32092_oob_impl(module, pos1, pos2, varargs, kw1, kw2);
2681 : :
2682 : 0 : exit:
2683 : 0 : Py_XDECREF(varargs);
2684 : 0 : return return_value;
2685 : : }
2686 : :
2687 : : PyDoc_STRVAR(gh_32092_kw_pass__doc__,
2688 : : "gh_32092_kw_pass($module, /, pos, *args, kw=None)\n"
2689 : : "--\n"
2690 : : "\n"
2691 : : "Proof-of-concept of GH-32092 keyword args passing bug.");
2692 : :
2693 : : #define GH_32092_KW_PASS_METHODDEF \
2694 : : {"gh_32092_kw_pass", _PyCFunction_CAST(gh_32092_kw_pass), METH_FASTCALL|METH_KEYWORDS, gh_32092_kw_pass__doc__},
2695 : :
2696 : : static PyObject *
2697 : : gh_32092_kw_pass_impl(PyObject *module, PyObject *pos, PyObject *args,
2698 : : PyObject *kw);
2699 : :
2700 : : static PyObject *
2701 : 0 : gh_32092_kw_pass(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2702 : : {
2703 : 0 : PyObject *return_value = NULL;
2704 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2705 : :
2706 : : #define NUM_KEYWORDS 2
2707 : : static struct {
2708 : : PyGC_Head _this_is_not_used;
2709 : : PyObject_VAR_HEAD
2710 : : PyObject *ob_item[NUM_KEYWORDS];
2711 : : } _kwtuple = {
2712 : : .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2713 : : .ob_item = { &_Py_ID(pos), &_Py_ID(kw), },
2714 : : };
2715 : : #undef NUM_KEYWORDS
2716 : : #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2717 : :
2718 : : #else // !Py_BUILD_CORE
2719 : : # define KWTUPLE NULL
2720 : : #endif // !Py_BUILD_CORE
2721 : :
2722 : : static const char * const _keywords[] = {"pos", "kw", NULL};
2723 : : static _PyArg_Parser _parser = {
2724 : : .keywords = _keywords,
2725 : : .fname = "gh_32092_kw_pass",
2726 : : .kwtuple = KWTUPLE,
2727 : : };
2728 : : #undef KWTUPLE
2729 : : PyObject *argsbuf[3];
2730 [ # # ]: 0 : Py_ssize_t noptargs = Py_MIN(nargs, 1) + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
2731 : : PyObject *pos;
2732 : 0 : PyObject *__clinic_args = NULL;
2733 : 0 : PyObject *kw = Py_None;
2734 : :
2735 : 0 : args = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, 1, argsbuf);
2736 [ # # ]: 0 : if (!args) {
2737 : 0 : goto exit;
2738 : : }
2739 : 0 : pos = args[0];
2740 : 0 : __clinic_args = args[1];
2741 [ # # ]: 0 : if (!noptargs) {
2742 : 0 : goto skip_optional_kwonly;
2743 : : }
2744 : 0 : kw = args[2];
2745 : 0 : skip_optional_kwonly:
2746 : 0 : return_value = gh_32092_kw_pass_impl(module, pos, __clinic_args, kw);
2747 : :
2748 : 0 : exit:
2749 : 0 : Py_XDECREF(__clinic_args);
2750 : 0 : return return_value;
2751 : : }
2752 : :
2753 : : PyDoc_STRVAR(gh_99233_refcount__doc__,
2754 : : "gh_99233_refcount($module, /, *args)\n"
2755 : : "--\n"
2756 : : "\n"
2757 : : "Proof-of-concept of GH-99233 refcount error bug.");
2758 : :
2759 : : #define GH_99233_REFCOUNT_METHODDEF \
2760 : : {"gh_99233_refcount", _PyCFunction_CAST(gh_99233_refcount), METH_FASTCALL, gh_99233_refcount__doc__},
2761 : :
2762 : : static PyObject *
2763 : : gh_99233_refcount_impl(PyObject *module, PyObject *args);
2764 : :
2765 : : static PyObject *
2766 : 0 : gh_99233_refcount(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
2767 : : {
2768 : 0 : PyObject *return_value = NULL;
2769 : 0 : PyObject *__clinic_args = NULL;
2770 : :
2771 [ # # ]: 0 : if (!_PyArg_CheckPositional("gh_99233_refcount", nargs, 0, PY_SSIZE_T_MAX)) {
2772 : 0 : goto exit;
2773 : : }
2774 : 0 : __clinic_args = PyTuple_New(nargs - 0);
2775 [ # # ]: 0 : if (!__clinic_args) {
2776 : 0 : goto exit;
2777 : : }
2778 [ # # ]: 0 : for (Py_ssize_t i = 0; i < nargs - 0; ++i) {
2779 : 0 : PyTuple_SET_ITEM(__clinic_args, i, Py_NewRef(args[0 + i]));
2780 : : }
2781 : 0 : return_value = gh_99233_refcount_impl(module, __clinic_args);
2782 : :
2783 : 0 : exit:
2784 : 0 : Py_XDECREF(__clinic_args);
2785 : 0 : return return_value;
2786 : : }
2787 : :
2788 : : PyDoc_STRVAR(gh_99240_double_free__doc__,
2789 : : "gh_99240_double_free($module, a, b, /)\n"
2790 : : "--\n"
2791 : : "\n"
2792 : : "Proof-of-concept of GH-99240 double-free bug.");
2793 : :
2794 : : #define GH_99240_DOUBLE_FREE_METHODDEF \
2795 : : {"gh_99240_double_free", _PyCFunction_CAST(gh_99240_double_free), METH_FASTCALL, gh_99240_double_free__doc__},
2796 : :
2797 : : static PyObject *
2798 : : gh_99240_double_free_impl(PyObject *module, char *a, char *b);
2799 : :
2800 : : static PyObject *
2801 : 0 : gh_99240_double_free(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
2802 : : {
2803 : 0 : PyObject *return_value = NULL;
2804 : 0 : char *a = NULL;
2805 : 0 : char *b = NULL;
2806 : :
2807 [ # # ]: 0 : if (!_PyArg_ParseStack(args, nargs, "eses:gh_99240_double_free",
2808 : : "idna", &a, "idna", &b)) {
2809 : 0 : goto exit;
2810 : : }
2811 : 0 : return_value = gh_99240_double_free_impl(module, a, b);
2812 : : /* Post parse cleanup for a */
2813 : 0 : PyMem_FREE(a);
2814 : : /* Post parse cleanup for b */
2815 : 0 : PyMem_FREE(b);
2816 : :
2817 : 0 : exit:
2818 : 0 : return return_value;
2819 : : }
2820 : : /*[clinic end generated code: output=e8211606b03d733a input=a9049054013a1b77]*/
|