Debian Codegraph @

Modules/clinic/_testclinic.c.h

raw
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 #endif
8 #include "pycore_abstract.h" // _PyNumber_Index()
9 #include "pycore_long.h" // _PyLong_UnsignedShort_Converter()
10 #include "pycore_modsupport.h" // _PyArg_CheckPositional()
11 #include "pycore_runtime.h" // _Py_ID()
12 #include "pycore_tuple.h" // _PyTuple_FromArray()
13
14 PyDoc_STRVAR(test_empty_function__doc__,
15 "test_empty_function($module, /)\n"
16 "--\n"
17 "\n");
18
19 #define TEST_EMPTY_FUNCTION_METHODDEF \
20 {"test_empty_function", (PyCFunction)test_empty_function, METH_NOARGS, test_empty_function__doc__},
21
22 static PyObject *
23 test_empty_function_impl(PyObject *module);
24
25 static PyObject *
26 test_empty_function(PyObject *module, PyObject *Py_UNUSED(ignored))
27 {
28 return test_empty_function_impl(module);
29 }
30
31 PyDoc_STRVAR(objects_converter__doc__,
32 "objects_converter($module, a, b=<unrepresentable>, /)\n"
33 "--\n"
34 "\n");
35
36 #define OBJECTS_CONVERTER_METHODDEF \
37 {"objects_converter", _PyCFunction_CAST(objects_converter), METH_FASTCALL, objects_converter__doc__},
38
39 static PyObject *
40 objects_converter_impl(PyObject *module, PyObject *a, PyObject *b);
41
42 static PyObject *
43 objects_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
44 {
45 PyObject *return_value = NULL;
46 PyObject *a;
47 PyObject *b = NULL;
48
49 if (!_PyArg_CheckPositional("objects_converter", nargs, 1, 2)) {
50 goto exit;
51 }
52 a = args[0];
53 if (nargs < 2) {
54 goto skip_optional;
55 }
56 b = args[1];
57 skip_optional:
58 return_value = objects_converter_impl(module, a, b);
59
60 exit:
61 return return_value;
62 }
63
64 PyDoc_STRVAR(bytes_object_converter__doc__,
65 "bytes_object_converter($module, a, /)\n"
66 "--\n"
67 "\n");
68
69 #define BYTES_OBJECT_CONVERTER_METHODDEF \
70 {"bytes_object_converter", (PyCFunction)bytes_object_converter, METH_O, bytes_object_converter__doc__},
71
72 static PyObject *
73 bytes_object_converter_impl(PyObject *module, PyBytesObject *a);
74
75 static PyObject *
76 bytes_object_converter(PyObject *module, PyObject *arg)
77 {
78 PyObject *return_value = NULL;
79 PyBytesObject *a;
80
81 if (!PyBytes_Check(arg)) {
82 _PyArg_BadArgument("bytes_object_converter", "argument", "bytes", arg);
83 goto exit;
84 }
85 a = (PyBytesObject *)arg;
86 return_value = bytes_object_converter_impl(module, a);
87
88 exit:
89 return return_value;
90 }
91
92 PyDoc_STRVAR(byte_array_object_converter__doc__,
93 "byte_array_object_converter($module, a, /)\n"
94 "--\n"
95 "\n");
96
97 #define BYTE_ARRAY_OBJECT_CONVERTER_METHODDEF \
98 {"byte_array_object_converter", (PyCFunction)byte_array_object_converter, METH_O, byte_array_object_converter__doc__},
99
100 static PyObject *
101 byte_array_object_converter_impl(PyObject *module, PyByteArrayObject *a);
102
103 static PyObject *
104 byte_array_object_converter(PyObject *module, PyObject *arg)
105 {
106 PyObject *return_value = NULL;
107 PyByteArrayObject *a;
108
109 if (!PyByteArray_Check(arg)) {
110 _PyArg_BadArgument("byte_array_object_converter", "argument", "bytearray", arg);
111 goto exit;
112 }
113 a = (PyByteArrayObject *)arg;
114 return_value = byte_array_object_converter_impl(module, a);
115
116 exit:
117 return return_value;
118 }
119
120 PyDoc_STRVAR(unicode_converter__doc__,
121 "unicode_converter($module, a, /)\n"
122 "--\n"
123 "\n");
124
125 #define UNICODE_CONVERTER_METHODDEF \
126 {"unicode_converter", (PyCFunction)unicode_converter, METH_O, unicode_converter__doc__},
127
128 static PyObject *
129 unicode_converter_impl(PyObject *module, PyObject *a);
130
131 static PyObject *
132 unicode_converter(PyObject *module, PyObject *arg)
133 {
134 PyObject *return_value = NULL;
135 PyObject *a;
136
137 if (!PyUnicode_Check(arg)) {
138 _PyArg_BadArgument("unicode_converter", "argument", "str", arg);
139 goto exit;
140 }
141 a = arg;
142 return_value = unicode_converter_impl(module, a);
143
144 exit:
145 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 bool_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
161 {
162 PyObject *return_value = NULL;
163 int a = 1;
164 int b = 1;
165 int c = 1;
166
167 if (!_PyArg_CheckPositional("bool_converter", nargs, 0, 3)) {
168 goto exit;
169 }
170 if (nargs < 1) {
171 goto skip_optional;
172 }
173 a = PyObject_IsTrue(args[0]);
174 if (a < 0) {
175 goto exit;
176 }
177 if (nargs < 2) {
178 goto skip_optional;
179 }
180 b = PyObject_IsTrue(args[1]);
181 if (b < 0) {
182 goto exit;
183 }
184 if (nargs < 3) {
185 goto skip_optional;
186 }
187 c = PyLong_AsInt(args[2]);
188 if (c == -1 && PyErr_Occurred()) {
189 goto exit;
190 }
191 skip_optional:
192 return_value = bool_converter_impl(module, a, b, c);
193
194 exit:
195 return return_value;
196 }
197
198 PyDoc_STRVAR(bool_converter_c_default__doc__,
199 "bool_converter_c_default($module, a=True, b=False, c=True, d=x, /)\n"
200 "--\n"
201 "\n");
202
203 #define BOOL_CONVERTER_C_DEFAULT_METHODDEF \
204 {"bool_converter_c_default", _PyCFunction_CAST(bool_converter_c_default), METH_FASTCALL, bool_converter_c_default__doc__},
205
206 static PyObject *
207 bool_converter_c_default_impl(PyObject *module, int a, int b, int c, int d);
208
209 static PyObject *
210 bool_converter_c_default(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
211 {
212 PyObject *return_value = NULL;
213 int a = 1;
214 int b = 0;
215 int c = -2;
216 int d = -3;
217
218 if (!_PyArg_CheckPositional("bool_converter_c_default", nargs, 0, 4)) {
219 goto exit;
220 }
221 if (nargs < 1) {
222 goto skip_optional;
223 }
224 a = PyObject_IsTrue(args[0]);
225 if (a < 0) {
226 goto exit;
227 }
228 if (nargs < 2) {
229 goto skip_optional;
230 }
231 b = PyObject_IsTrue(args[1]);
232 if (b < 0) {
233 goto exit;
234 }
235 if (nargs < 3) {
236 goto skip_optional;
237 }
238 c = PyObject_IsTrue(args[2]);
239 if (c < 0) {
240 goto exit;
241 }
242 if (nargs < 4) {
243 goto skip_optional;
244 }
245 d = PyObject_IsTrue(args[3]);
246 if (d < 0) {
247 goto exit;
248 }
249 skip_optional:
250 return_value = bool_converter_c_default_impl(module, a, b, c, d);
251
252 exit:
253 return return_value;
254 }
255
256 PyDoc_STRVAR(char_converter__doc__,
257 "char_converter($module, a=b\'A\', b=b\'\\x07\', c=b\'\\x08\', d=b\'\\t\', e=b\'\\n\',\n"
258 " f=b\'\\x0b\', g=b\'\\x0c\', h=b\'\\r\', i=b\'\"\', j=b\"\'\", k=b\'?\',\n"
259 " l=b\'\\\\\', m=b\'\\x00\', n=b\'\\xff\', /)\n"
260 "--\n"
261 "\n");
262
263 #define CHAR_CONVERTER_METHODDEF \
264 {"char_converter", _PyCFunction_CAST(char_converter), METH_FASTCALL, char_converter__doc__},
265
266 static PyObject *
267 char_converter_impl(PyObject *module, char a, char b, char c, char d, char e,
268 char f, char g, char h, char i, char j, char k, char l,
269 char m, char n);
270
271 static PyObject *
272 char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
273 {
274 PyObject *return_value = NULL;
275 char a = 'A';
276 char b = '\a';
277 char c = '\b';
278 char d = '\t';
279 char e = '\n';
280 char f = '\v';
281 char g = '\f';
282 char h = '\r';
283 char i = '"';
284 char j = '\'';
285 char k = '?';
286 char l = '\\';
287 char m = '\0';
288 char n = '\377';
289
290 if (!_PyArg_CheckPositional("char_converter", nargs, 0, 14)) {
291 goto exit;
292 }
293 if (nargs < 1) {
294 goto skip_optional;
295 }
296 if (PyBytes_Check(args[0])) {
297 if (PyBytes_GET_SIZE(args[0]) != 1) {
298 PyErr_Format(PyExc_TypeError,
299 "char_converter(): argument 1 must be a byte string of length 1, "
300 "not a bytes object of length %zd",
301 PyBytes_GET_SIZE(args[0]));
302 goto exit;
303 }
304 a = PyBytes_AS_STRING(args[0])[0];
305 }
306 else if (PyByteArray_Check(args[0])) {
307 if (PyByteArray_GET_SIZE(args[0]) != 1) {
308 PyErr_Format(PyExc_TypeError,
309 "char_converter(): argument 1 must be a byte string of length 1, "
310 "not a bytearray object of length %zd",
311 PyByteArray_GET_SIZE(args[0]));
312 goto exit;
313 }
314 a = PyByteArray_AS_STRING(args[0])[0];
315 }
316 else {
317 _PyArg_BadArgument("char_converter", "argument 1", "a byte string of length 1", args[0]);
318 goto exit;
319 }
320 if (nargs < 2) {
321 goto skip_optional;
322 }
323 if (PyBytes_Check(args[1])) {
324 if (PyBytes_GET_SIZE(args[1]) != 1) {
325 PyErr_Format(PyExc_TypeError,
326 "char_converter(): argument 2 must be a byte string of length 1, "
327 "not a bytes object of length %zd",
328 PyBytes_GET_SIZE(args[1]));
329 goto exit;
330 }
331 b = PyBytes_AS_STRING(args[1])[0];
332 }
333 else if (PyByteArray_Check(args[1])) {
334 if (PyByteArray_GET_SIZE(args[1]) != 1) {
335 PyErr_Format(PyExc_TypeError,
336 "char_converter(): argument 2 must be a byte string of length 1, "
337 "not a bytearray object of length %zd",
338 PyByteArray_GET_SIZE(args[1]));
339 goto exit;
340 }
341 b = PyByteArray_AS_STRING(args[1])[0];
342 }
343 else {
344 _PyArg_BadArgument("char_converter", "argument 2", "a byte string of length 1", args[1]);
345 goto exit;
346 }
347 if (nargs < 3) {
348 goto skip_optional;
349 }
350 if (PyBytes_Check(args[2])) {
351 if (PyBytes_GET_SIZE(args[2]) != 1) {
352 PyErr_Format(PyExc_TypeError,
353 "char_converter(): argument 3 must be a byte string of length 1, "
354 "not a bytes object of length %zd",
355 PyBytes_GET_SIZE(args[2]));
356 goto exit;
357 }
358 c = PyBytes_AS_STRING(args[2])[0];
359 }
360 else if (PyByteArray_Check(args[2])) {
361 if (PyByteArray_GET_SIZE(args[2]) != 1) {
362 PyErr_Format(PyExc_TypeError,
363 "char_converter(): argument 3 must be a byte string of length 1, "
364 "not a bytearray object of length %zd",
365 PyByteArray_GET_SIZE(args[2]));
366 goto exit;
367 }
368 c = PyByteArray_AS_STRING(args[2])[0];
369 }
370 else {
371 _PyArg_BadArgument("char_converter", "argument 3", "a byte string of length 1", args[2]);
372 goto exit;
373 }
374 if (nargs < 4) {
375 goto skip_optional;
376 }
377 if (PyBytes_Check(args[3])) {
378 if (PyBytes_GET_SIZE(args[3]) != 1) {
379 PyErr_Format(PyExc_TypeError,
380 "char_converter(): argument 4 must be a byte string of length 1, "
381 "not a bytes object of length %zd",
382 PyBytes_GET_SIZE(args[3]));
383 goto exit;
384 }
385 d = PyBytes_AS_STRING(args[3])[0];
386 }
387 else if (PyByteArray_Check(args[3])) {
388 if (PyByteArray_GET_SIZE(args[3]) != 1) {
389 PyErr_Format(PyExc_TypeError,
390 "char_converter(): argument 4 must be a byte string of length 1, "
391 "not a bytearray object of length %zd",
392 PyByteArray_GET_SIZE(args[3]));
393 goto exit;
394 }
395 d = PyByteArray_AS_STRING(args[3])[0];
396 }
397 else {
398 _PyArg_BadArgument("char_converter", "argument 4", "a byte string of length 1", args[3]);
399 goto exit;
400 }
401 if (nargs < 5) {
402 goto skip_optional;
403 }
404 if (PyBytes_Check(args[4])) {
405 if (PyBytes_GET_SIZE(args[4]) != 1) {
406 PyErr_Format(PyExc_TypeError,
407 "char_converter(): argument 5 must be a byte string of length 1, "
408 "not a bytes object of length %zd",
409 PyBytes_GET_SIZE(args[4]));
410 goto exit;
411 }
412 e = PyBytes_AS_STRING(args[4])[0];
413 }
414 else if (PyByteArray_Check(args[4])) {
415 if (PyByteArray_GET_SIZE(args[4]) != 1) {
416 PyErr_Format(PyExc_TypeError,
417 "char_converter(): argument 5 must be a byte string of length 1, "
418 "not a bytearray object of length %zd",
419 PyByteArray_GET_SIZE(args[4]));
420 goto exit;
421 }
422 e = PyByteArray_AS_STRING(args[4])[0];
423 }
424 else {
425 _PyArg_BadArgument("char_converter", "argument 5", "a byte string of length 1", args[4]);
426 goto exit;
427 }
428 if (nargs < 6) {
429 goto skip_optional;
430 }
431 if (PyBytes_Check(args[5])) {
432 if (PyBytes_GET_SIZE(args[5]) != 1) {
433 PyErr_Format(PyExc_TypeError,
434 "char_converter(): argument 6 must be a byte string of length 1, "
435 "not a bytes object of length %zd",
436 PyBytes_GET_SIZE(args[5]));
437 goto exit;
438 }
439 f = PyBytes_AS_STRING(args[5])[0];
440 }
441 else if (PyByteArray_Check(args[5])) {
442 if (PyByteArray_GET_SIZE(args[5]) != 1) {
443 PyErr_Format(PyExc_TypeError,
444 "char_converter(): argument 6 must be a byte string of length 1, "
445 "not a bytearray object of length %zd",
446 PyByteArray_GET_SIZE(args[5]));
447 goto exit;
448 }
449 f = PyByteArray_AS_STRING(args[5])[0];
450 }
451 else {
452 _PyArg_BadArgument("char_converter", "argument 6", "a byte string of length 1", args[5]);
453 goto exit;
454 }
455 if (nargs < 7) {
456 goto skip_optional;
457 }
458 if (PyBytes_Check(args[6])) {
459 if (PyBytes_GET_SIZE(args[6]) != 1) {
460 PyErr_Format(PyExc_TypeError,
461 "char_converter(): argument 7 must be a byte string of length 1, "
462 "not a bytes object of length %zd",
463 PyBytes_GET_SIZE(args[6]));
464 goto exit;
465 }
466 g = PyBytes_AS_STRING(args[6])[0];
467 }
468 else if (PyByteArray_Check(args[6])) {
469 if (PyByteArray_GET_SIZE(args[6]) != 1) {
470 PyErr_Format(PyExc_TypeError,
471 "char_converter(): argument 7 must be a byte string of length 1, "
472 "not a bytearray object of length %zd",
473 PyByteArray_GET_SIZE(args[6]));
474 goto exit;
475 }
476 g = PyByteArray_AS_STRING(args[6])[0];
477 }
478 else {
479 _PyArg_BadArgument("char_converter", "argument 7", "a byte string of length 1", args[6]);
480 goto exit;
481 }
482 if (nargs < 8) {
483 goto skip_optional;
484 }
485 if (PyBytes_Check(args[7])) {
486 if (PyBytes_GET_SIZE(args[7]) != 1) {
487 PyErr_Format(PyExc_TypeError,
488 "char_converter(): argument 8 must be a byte string of length 1, "
489 "not a bytes object of length %zd",
490 PyBytes_GET_SIZE(args[7]));
491 goto exit;
492 }
493 h = PyBytes_AS_STRING(args[7])[0];
494 }
495 else if (PyByteArray_Check(args[7])) {
496 if (PyByteArray_GET_SIZE(args[7]) != 1) {
497 PyErr_Format(PyExc_TypeError,
498 "char_converter(): argument 8 must be a byte string of length 1, "
499 "not a bytearray object of length %zd",
500 PyByteArray_GET_SIZE(args[7]));
501 goto exit;
502 }
503 h = PyByteArray_AS_STRING(args[7])[0];
504 }
505 else {
506 _PyArg_BadArgument("char_converter", "argument 8", "a byte string of length 1", args[7]);
507 goto exit;
508 }
509 if (nargs < 9) {
510 goto skip_optional;
511 }
512 if (PyBytes_Check(args[8])) {
513 if (PyBytes_GET_SIZE(args[8]) != 1) {
514 PyErr_Format(PyExc_TypeError,
515 "char_converter(): argument 9 must be a byte string of length 1, "
516 "not a bytes object of length %zd",
517 PyBytes_GET_SIZE(args[8]));
518 goto exit;
519 }
520 i = PyBytes_AS_STRING(args[8])[0];
521 }
522 else if (PyByteArray_Check(args[8])) {
523 if (PyByteArray_GET_SIZE(args[8]) != 1) {
524 PyErr_Format(PyExc_TypeError,
525 "char_converter(): argument 9 must be a byte string of length 1, "
526 "not a bytearray object of length %zd",
527 PyByteArray_GET_SIZE(args[8]));
528 goto exit;
529 }
530 i = PyByteArray_AS_STRING(args[8])[0];
531 }
532 else {
533 _PyArg_BadArgument("char_converter", "argument 9", "a byte string of length 1", args[8]);
534 goto exit;
535 }
536 if (nargs < 10) {
537 goto skip_optional;
538 }
539 if (PyBytes_Check(args[9])) {
540 if (PyBytes_GET_SIZE(args[9]) != 1) {
541 PyErr_Format(PyExc_TypeError,
542 "char_converter(): argument 10 must be a byte string of length 1, "
543 "not a bytes object of length %zd",
544 PyBytes_GET_SIZE(args[9]));
545 goto exit;
546 }
547 j = PyBytes_AS_STRING(args[9])[0];
548 }
549 else if (PyByteArray_Check(args[9])) {
550 if (PyByteArray_GET_SIZE(args[9]) != 1) {
551 PyErr_Format(PyExc_TypeError,
552 "char_converter(): argument 10 must be a byte string of length 1, "
553 "not a bytearray object of length %zd",
554 PyByteArray_GET_SIZE(args[9]));
555 goto exit;
556 }
557 j = PyByteArray_AS_STRING(args[9])[0];
558 }
559 else {
560 _PyArg_BadArgument("char_converter", "argument 10", "a byte string of length 1", args[9]);
561 goto exit;
562 }
563 if (nargs < 11) {
564 goto skip_optional;
565 }
566 if (PyBytes_Check(args[10])) {
567 if (PyBytes_GET_SIZE(args[10]) != 1) {
568 PyErr_Format(PyExc_TypeError,
569 "char_converter(): argument 11 must be a byte string of length 1, "
570 "not a bytes object of length %zd",
571 PyBytes_GET_SIZE(args[10]));
572 goto exit;
573 }
574 k = PyBytes_AS_STRING(args[10])[0];
575 }
576 else if (PyByteArray_Check(args[10])) {
577 if (PyByteArray_GET_SIZE(args[10]) != 1) {
578 PyErr_Format(PyExc_TypeError,
579 "char_converter(): argument 11 must be a byte string of length 1, "
580 "not a bytearray object of length %zd",
581 PyByteArray_GET_SIZE(args[10]));
582 goto exit;
583 }
584 k = PyByteArray_AS_STRING(args[10])[0];
585 }
586 else {
587 _PyArg_BadArgument("char_converter", "argument 11", "a byte string of length 1", args[10]);
588 goto exit;
589 }
590 if (nargs < 12) {
591 goto skip_optional;
592 }
593 if (PyBytes_Check(args[11])) {
594 if (PyBytes_GET_SIZE(args[11]) != 1) {
595 PyErr_Format(PyExc_TypeError,
596 "char_converter(): argument 12 must be a byte string of length 1, "
597 "not a bytes object of length %zd",
598 PyBytes_GET_SIZE(args[11]));
599 goto exit;
600 }
601 l = PyBytes_AS_STRING(args[11])[0];
602 }
603 else if (PyByteArray_Check(args[11])) {
604 if (PyByteArray_GET_SIZE(args[11]) != 1) {
605 PyErr_Format(PyExc_TypeError,
606 "char_converter(): argument 12 must be a byte string of length 1, "
607 "not a bytearray object of length %zd",
608 PyByteArray_GET_SIZE(args[11]));
609 goto exit;
610 }
611 l = PyByteArray_AS_STRING(args[11])[0];
612 }
613 else {
614 _PyArg_BadArgument("char_converter", "argument 12", "a byte string of length 1", args[11]);
615 goto exit;
616 }
617 if (nargs < 13) {
618 goto skip_optional;
619 }
620 if (PyBytes_Check(args[12])) {
621 if (PyBytes_GET_SIZE(args[12]) != 1) {
622 PyErr_Format(PyExc_TypeError,
623 "char_converter(): argument 13 must be a byte string of length 1, "
624 "not a bytes object of length %zd",
625 PyBytes_GET_SIZE(args[12]));
626 goto exit;
627 }
628 m = PyBytes_AS_STRING(args[12])[0];
629 }
630 else if (PyByteArray_Check(args[12])) {
631 if (PyByteArray_GET_SIZE(args[12]) != 1) {
632 PyErr_Format(PyExc_TypeError,
633 "char_converter(): argument 13 must be a byte string of length 1, "
634 "not a bytearray object of length %zd",
635 PyByteArray_GET_SIZE(args[12]));
636 goto exit;
637 }
638 m = PyByteArray_AS_STRING(args[12])[0];
639 }
640 else {
641 _PyArg_BadArgument("char_converter", "argument 13", "a byte string of length 1", args[12]);
642 goto exit;
643 }
644 if (nargs < 14) {
645 goto skip_optional;
646 }
647 if (PyBytes_Check(args[13])) {
648 if (PyBytes_GET_SIZE(args[13]) != 1) {
649 PyErr_Format(PyExc_TypeError,
650 "char_converter(): argument 14 must be a byte string of length 1, "
651 "not a bytes object of length %zd",
652 PyBytes_GET_SIZE(args[13]));
653 goto exit;
654 }
655 n = PyBytes_AS_STRING(args[13])[0];
656 }
657 else if (PyByteArray_Check(args[13])) {
658 if (PyByteArray_GET_SIZE(args[13]) != 1) {
659 PyErr_Format(PyExc_TypeError,
660 "char_converter(): argument 14 must be a byte string of length 1, "
661 "not a bytearray object of length %zd",
662 PyByteArray_GET_SIZE(args[13]));
663 goto exit;
664 }
665 n = PyByteArray_AS_STRING(args[13])[0];
666 }
667 else {
668 _PyArg_BadArgument("char_converter", "argument 14", "a byte string of length 1", args[13]);
669 goto exit;
670 }
671 skip_optional:
672 return_value = char_converter_impl(module, a, b, c, d, e, f, g, h, i, j, k, l, m, n);
673
674 exit:
675 return return_value;
676 }
677
678 PyDoc_STRVAR(unsigned_char_converter__doc__,
679 "unsigned_char_converter($module, a=12, b=34, c=56, /)\n"
680 "--\n"
681 "\n");
682
683 #define UNSIGNED_CHAR_CONVERTER_METHODDEF \
684 {"unsigned_char_converter", _PyCFunction_CAST(unsigned_char_converter), METH_FASTCALL, unsigned_char_converter__doc__},
685
686 static PyObject *
687 unsigned_char_converter_impl(PyObject *module, unsigned char a,
688 unsigned char b, unsigned char c);
689
690 static PyObject *
691 unsigned_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
692 {
693 PyObject *return_value = NULL;
694 unsigned char a = 12;
695 unsigned char b = 34;
696 unsigned char c = 56;
697
698 if (!_PyArg_CheckPositional("unsigned_char_converter", nargs, 0, 3)) {
699 goto exit;
700 }
701 if (nargs < 1) {
702 goto skip_optional;
703 }
704 {
705 long ival = PyLong_AsLong(args[0]);
706 if (ival == -1 && PyErr_Occurred()) {
707 goto exit;
708 }
709 else if (ival < 0) {
710 PyErr_SetString(PyExc_OverflowError,
711 "unsigned byte integer is less than minimum");
712 goto exit;
713 }
714 else if (ival > UCHAR_MAX) {
715 PyErr_SetString(PyExc_OverflowError,
716 "unsigned byte integer is greater than maximum");
717 goto exit;
718 }
719 else {
720 a = (unsigned char) ival;
721 }
722 }
723 if (nargs < 2) {
724 goto skip_optional;
725 }
726 {
727 long ival = PyLong_AsLong(args[1]);
728 if (ival == -1 && PyErr_Occurred()) {
729 goto exit;
730 }
731 else if (ival < 0) {
732 PyErr_SetString(PyExc_OverflowError,
733 "unsigned byte integer is less than minimum");
734 goto exit;
735 }
736 else if (ival > UCHAR_MAX) {
737 PyErr_SetString(PyExc_OverflowError,
738 "unsigned byte integer is greater than maximum");
739 goto exit;
740 }
741 else {
742 b = (unsigned char) ival;
743 }
744 }
745 if (nargs < 3) {
746 goto skip_optional;
747 }
748 {
749 unsigned long ival = PyLong_AsUnsignedLongMask(args[2]);
750 if (ival == (unsigned long)-1 && PyErr_Occurred()) {
751 goto exit;
752 }
753 else {
754 c = (unsigned char) ival;
755 }
756 }
757 skip_optional:
758 return_value = unsigned_char_converter_impl(module, a, b, c);
759
760 exit:
761 return return_value;
762 }
763
764 PyDoc_STRVAR(short_converter__doc__,
765 "short_converter($module, a=12, /)\n"
766 "--\n"
767 "\n");
768
769 #define SHORT_CONVERTER_METHODDEF \
770 {"short_converter", _PyCFunction_CAST(short_converter), METH_FASTCALL, short_converter__doc__},
771
772 static PyObject *
773 short_converter_impl(PyObject *module, short a);
774
775 static PyObject *
776 short_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
777 {
778 PyObject *return_value = NULL;
779 short a = 12;
780
781 if (!_PyArg_CheckPositional("short_converter", nargs, 0, 1)) {
782 goto exit;
783 }
784 if (nargs < 1) {
785 goto skip_optional;
786 }
787 {
788 long ival = PyLong_AsLong(args[0]);
789 if (ival == -1 && PyErr_Occurred()) {
790 goto exit;
791 }
792 else if (ival < SHRT_MIN) {
793 PyErr_SetString(PyExc_OverflowError,
794 "signed short integer is less than minimum");
795 goto exit;
796 }
797 else if (ival > SHRT_MAX) {
798 PyErr_SetString(PyExc_OverflowError,
799 "signed short integer is greater than maximum");
800 goto exit;
801 }
802 else {
803 a = (short) ival;
804 }
805 }
806 skip_optional:
807 return_value = short_converter_impl(module, a);
808
809 exit:
810 return return_value;
811 }
812
813 PyDoc_STRVAR(unsigned_short_converter__doc__,
814 "unsigned_short_converter($module, a=12, b=34, c=56, /)\n"
815 "--\n"
816 "\n");
817
818 #define UNSIGNED_SHORT_CONVERTER_METHODDEF \
819 {"unsigned_short_converter", _PyCFunction_CAST(unsigned_short_converter), METH_FASTCALL, unsigned_short_converter__doc__},
820
821 static PyObject *
822 unsigned_short_converter_impl(PyObject *module, unsigned short a,
823 unsigned short b, unsigned short c);
824
825 static PyObject *
826 unsigned_short_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
827 {
828 PyObject *return_value = NULL;
829 unsigned short a = 12;
830 unsigned short b = 34;
831 unsigned short c = 56;
832
833 if (!_PyArg_CheckPositional("unsigned_short_converter", nargs, 0, 3)) {
834 goto exit;
835 }
836 if (nargs < 1) {
837 goto skip_optional;
838 }
839 if (!_PyLong_UnsignedShort_Converter(args[0], &a)) {
840 goto exit;
841 }
842 if (nargs < 2) {
843 goto skip_optional;
844 }
845 if (!_PyLong_UnsignedShort_Converter(args[1], &b)) {
846 goto exit;
847 }
848 if (nargs < 3) {
849 goto skip_optional;
850 }
851 c = (unsigned short)PyLong_AsUnsignedLongMask(args[2]);
852 if (c == (unsigned short)-1 && PyErr_Occurred()) {
853 goto exit;
854 }
855 skip_optional:
856 return_value = unsigned_short_converter_impl(module, a, b, c);
857
858 exit:
859 return return_value;
860 }
861
862 PyDoc_STRVAR(int_converter__doc__,
863 "int_converter($module, a=12, b=34, c=\'-\', /)\n"
864 "--\n"
865 "\n");
866
867 #define INT_CONVERTER_METHODDEF \
868 {"int_converter", _PyCFunction_CAST(int_converter), METH_FASTCALL, int_converter__doc__},
869
870 static PyObject *
871 int_converter_impl(PyObject *module, int a, int b, int c);
872
873 static PyObject *
874 int_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
875 {
876 PyObject *return_value = NULL;
877 int a = 12;
878 int b = 34;
879 int c = '-';
880
881 if (!_PyArg_CheckPositional("int_converter", nargs, 0, 3)) {
882 goto exit;
883 }
884 if (nargs < 1) {
885 goto skip_optional;
886 }
887 a = PyLong_AsInt(args[0]);
888 if (a == -1 && PyErr_Occurred()) {
889 goto exit;
890 }
891 if (nargs < 2) {
892 goto skip_optional;
893 }
894 b = PyLong_AsInt(args[1]);
895 if (b == -1 && PyErr_Occurred()) {
896 goto exit;
897 }
898 if (nargs < 3) {
899 goto skip_optional;
900 }
901 if (!PyUnicode_Check(args[2])) {
902 _PyArg_BadArgument("int_converter", "argument 3", "a unicode character", args[2]);
903 goto exit;
904 }
905 if (PyUnicode_GET_LENGTH(args[2]) != 1) {
906 PyErr_Format(PyExc_TypeError,
907 "int_converter(): argument 3 must be a unicode character, "
908 "not a string of length %zd",
909 PyUnicode_GET_LENGTH(args[2]));
910 goto exit;
911 }
912 c = PyUnicode_READ_CHAR(args[2], 0);
913 skip_optional:
914 return_value = int_converter_impl(module, a, b, c);
915
916 exit:
917 return return_value;
918 }
919
920 PyDoc_STRVAR(unsigned_int_converter__doc__,
921 "unsigned_int_converter($module, a=12, b=34, c=56, /)\n"
922 "--\n"
923 "\n");
924
925 #define UNSIGNED_INT_CONVERTER_METHODDEF \
926 {"unsigned_int_converter", _PyCFunction_CAST(unsigned_int_converter), METH_FASTCALL, unsigned_int_converter__doc__},
927
928 static PyObject *
929 unsigned_int_converter_impl(PyObject *module, unsigned int a, unsigned int b,
930 unsigned int c);
931
932 static PyObject *
933 unsigned_int_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
934 {
935 PyObject *return_value = NULL;
936 unsigned int a = 12;
937 unsigned int b = 34;
938 unsigned int c = 56;
939
940 if (!_PyArg_CheckPositional("unsigned_int_converter", nargs, 0, 3)) {
941 goto exit;
942 }
943 if (nargs < 1) {
944 goto skip_optional;
945 }
946 if (!_PyLong_UnsignedInt_Converter(args[0], &a)) {
947 goto exit;
948 }
949 if (nargs < 2) {
950 goto skip_optional;
951 }
952 if (!_PyLong_UnsignedInt_Converter(args[1], &b)) {
953 goto exit;
954 }
955 if (nargs < 3) {
956 goto skip_optional;
957 }
958 c = (unsigned int)PyLong_AsUnsignedLongMask(args[2]);
959 if (c == (unsigned int)-1 && PyErr_Occurred()) {
960 goto exit;
961 }
962 skip_optional:
963 return_value = unsigned_int_converter_impl(module, a, b, c);
964
965 exit:
966 return return_value;
967 }
968
969 PyDoc_STRVAR(long_converter__doc__,
970 "long_converter($module, a=12, /)\n"
971 "--\n"
972 "\n");
973
974 #define LONG_CONVERTER_METHODDEF \
975 {"long_converter", _PyCFunction_CAST(long_converter), METH_FASTCALL, long_converter__doc__},
976
977 static PyObject *
978 long_converter_impl(PyObject *module, long a);
979
980 static PyObject *
981 long_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
982 {
983 PyObject *return_value = NULL;
984 long a = 12;
985
986 if (!_PyArg_CheckPositional("long_converter", nargs, 0, 1)) {
987 goto exit;
988 }
989 if (nargs < 1) {
990 goto skip_optional;
991 }
992 a = PyLong_AsLong(args[0]);
993 if (a == -1 && PyErr_Occurred()) {
994 goto exit;
995 }
996 skip_optional:
997 return_value = long_converter_impl(module, a);
998
999 exit:
1000 return return_value;
1001 }
1002
1003 PyDoc_STRVAR(unsigned_long_converter__doc__,
1004 "unsigned_long_converter($module, a=12, b=34, c=56, /)\n"
1005 "--\n"
1006 "\n");
1007
1008 #define UNSIGNED_LONG_CONVERTER_METHODDEF \
1009 {"unsigned_long_converter", _PyCFunction_CAST(unsigned_long_converter), METH_FASTCALL, unsigned_long_converter__doc__},
1010
1011 static PyObject *
1012 unsigned_long_converter_impl(PyObject *module, unsigned long a,
1013 unsigned long b, unsigned long c);
1014
1015 static PyObject *
1016 unsigned_long_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1017 {
1018 PyObject *return_value = NULL;
1019 unsigned long a = 12;
1020 unsigned long b = 34;
1021 unsigned long c = 56;
1022
1023 if (!_PyArg_CheckPositional("unsigned_long_converter", nargs, 0, 3)) {
1024 goto exit;
1025 }
1026 if (nargs < 1) {
1027 goto skip_optional;
1028 }
1029 if (!_PyLong_UnsignedLong_Converter(args[0], &a)) {
1030 goto exit;
1031 }
1032 if (nargs < 2) {
1033 goto skip_optional;
1034 }
1035 if (!_PyLong_UnsignedLong_Converter(args[1], &b)) {
1036 goto exit;
1037 }
1038 if (nargs < 3) {
1039 goto skip_optional;
1040 }
1041 if (!PyIndex_Check(args[2])) {
1042 _PyArg_BadArgument("unsigned_long_converter", "argument 3", "int", args[2]);
1043 goto exit;
1044 }
1045 c = PyLong_AsUnsignedLongMask(args[2]);
1046 skip_optional:
1047 return_value = unsigned_long_converter_impl(module, a, b, c);
1048
1049 exit:
1050 return return_value;
1051 }
1052
1053 PyDoc_STRVAR(long_long_converter__doc__,
1054 "long_long_converter($module, a=12, /)\n"
1055 "--\n"
1056 "\n");
1057
1058 #define LONG_LONG_CONVERTER_METHODDEF \
1059 {"long_long_converter", _PyCFunction_CAST(long_long_converter), METH_FASTCALL, long_long_converter__doc__},
1060
1061 static PyObject *
1062 long_long_converter_impl(PyObject *module, long long a);
1063
1064 static PyObject *
1065 long_long_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1066 {
1067 PyObject *return_value = NULL;
1068 long long a = 12;
1069
1070 if (!_PyArg_CheckPositional("long_long_converter", nargs, 0, 1)) {
1071 goto exit;
1072 }
1073 if (nargs < 1) {
1074 goto skip_optional;
1075 }
1076 a = PyLong_AsLongLong(args[0]);
1077 if (a == -1 && PyErr_Occurred()) {
1078 goto exit;
1079 }
1080 skip_optional:
1081 return_value = long_long_converter_impl(module, a);
1082
1083 exit:
1084 return return_value;
1085 }
1086
1087 PyDoc_STRVAR(unsigned_long_long_converter__doc__,
1088 "unsigned_long_long_converter($module, a=12, b=34, c=56, /)\n"
1089 "--\n"
1090 "\n");
1091
1092 #define UNSIGNED_LONG_LONG_CONVERTER_METHODDEF \
1093 {"unsigned_long_long_converter", _PyCFunction_CAST(unsigned_long_long_converter), METH_FASTCALL, unsigned_long_long_converter__doc__},
1094
1095 static PyObject *
1096 unsigned_long_long_converter_impl(PyObject *module, unsigned long long a,
1097 unsigned long long b, unsigned long long c);
1098
1099 static PyObject *
1100 unsigned_long_long_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1101 {
1102 PyObject *return_value = NULL;
1103 unsigned long long a = 12;
1104 unsigned long long b = 34;
1105 unsigned long long c = 56;
1106
1107 if (!_PyArg_CheckPositional("unsigned_long_long_converter", nargs, 0, 3)) {
1108 goto exit;
1109 }
1110 if (nargs < 1) {
1111 goto skip_optional;
1112 }
1113 if (!_PyLong_UnsignedLongLong_Converter(args[0], &a)) {
1114 goto exit;
1115 }
1116 if (nargs < 2) {
1117 goto skip_optional;
1118 }
1119 if (!_PyLong_UnsignedLongLong_Converter(args[1], &b)) {
1120 goto exit;
1121 }
1122 if (nargs < 3) {
1123 goto skip_optional;
1124 }
1125 if (!PyIndex_Check(args[2])) {
1126 _PyArg_BadArgument("unsigned_long_long_converter", "argument 3", "int", args[2]);
1127 goto exit;
1128 }
1129 c = PyLong_AsUnsignedLongLongMask(args[2]);
1130 skip_optional:
1131 return_value = unsigned_long_long_converter_impl(module, a, b, c);
1132
1133 exit:
1134 return return_value;
1135 }
1136
1137 PyDoc_STRVAR(py_ssize_t_converter__doc__,
1138 "py_ssize_t_converter($module, a=12, b=34, c=56, /)\n"
1139 "--\n"
1140 "\n");
1141
1142 #define PY_SSIZE_T_CONVERTER_METHODDEF \
1143 {"py_ssize_t_converter", _PyCFunction_CAST(py_ssize_t_converter), METH_FASTCALL, py_ssize_t_converter__doc__},
1144
1145 static PyObject *
1146 py_ssize_t_converter_impl(PyObject *module, Py_ssize_t a, Py_ssize_t b,
1147 Py_ssize_t c);
1148
1149 static PyObject *
1150 py_ssize_t_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1151 {
1152 PyObject *return_value = NULL;
1153 Py_ssize_t a = 12;
1154 Py_ssize_t b = 34;
1155 Py_ssize_t c = 56;
1156
1157 if (!_PyArg_CheckPositional("py_ssize_t_converter", nargs, 0, 3)) {
1158 goto exit;
1159 }
1160 if (nargs < 1) {
1161 goto skip_optional;
1162 }
1163 {
1164 Py_ssize_t ival = -1;
1165 PyObject *iobj = _PyNumber_Index(args[0]);
1166 if (iobj != NULL) {
1167 ival = PyLong_AsSsize_t(iobj);
1168 Py_DECREF(iobj);
1169 }
1170 if (ival == -1 && PyErr_Occurred()) {
1171 goto exit;
1172 }
1173 a = ival;
1174 }
1175 if (nargs < 2) {
1176 goto skip_optional;
1177 }
1178 {
1179 Py_ssize_t ival = -1;
1180 PyObject *iobj = _PyNumber_Index(args[1]);
1181 if (iobj != NULL) {
1182 ival = PyLong_AsSsize_t(iobj);
1183 Py_DECREF(iobj);
1184 }
1185 if (ival == -1 && PyErr_Occurred()) {
1186 goto exit;
1187 }
1188 b = ival;
1189 }
1190 if (nargs < 3) {
1191 goto skip_optional;
1192 }
1193 if (!_Py_convert_optional_to_ssize_t(args[2], &c)) {
1194 goto exit;
1195 }
1196 skip_optional:
1197 return_value = py_ssize_t_converter_impl(module, a, b, c);
1198
1199 exit:
1200 return return_value;
1201 }
1202
1203 PyDoc_STRVAR(slice_index_converter__doc__,
1204 "slice_index_converter($module, a=12, b=34, c=56, /)\n"
1205 "--\n"
1206 "\n");
1207
1208 #define SLICE_INDEX_CONVERTER_METHODDEF \
1209 {"slice_index_converter", _PyCFunction_CAST(slice_index_converter), METH_FASTCALL, slice_index_converter__doc__},
1210
1211 static PyObject *
1212 slice_index_converter_impl(PyObject *module, Py_ssize_t a, Py_ssize_t b,
1213 Py_ssize_t c);
1214
1215 static PyObject *
1216 slice_index_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1217 {
1218 PyObject *return_value = NULL;
1219 Py_ssize_t a = 12;
1220 Py_ssize_t b = 34;
1221 Py_ssize_t c = 56;
1222
1223 if (!_PyArg_CheckPositional("slice_index_converter", nargs, 0, 3)) {
1224 goto exit;
1225 }
1226 if (nargs < 1) {
1227 goto skip_optional;
1228 }
1229 if (!_PyEval_SliceIndex(args[0], &a)) {
1230 goto exit;
1231 }
1232 if (nargs < 2) {
1233 goto skip_optional;
1234 }
1235 if (!_PyEval_SliceIndexNotNone(args[1], &b)) {
1236 goto exit;
1237 }
1238 if (nargs < 3) {
1239 goto skip_optional;
1240 }
1241 if (!_PyEval_SliceIndex(args[2], &c)) {
1242 goto exit;
1243 }
1244 skip_optional:
1245 return_value = slice_index_converter_impl(module, a, b, c);
1246
1247 exit:
1248 return return_value;
1249 }
1250
1251 PyDoc_STRVAR(size_t_converter__doc__,
1252 "size_t_converter($module, a=12, /)\n"
1253 "--\n"
1254 "\n");
1255
1256 #define SIZE_T_CONVERTER_METHODDEF \
1257 {"size_t_converter", _PyCFunction_CAST(size_t_converter), METH_FASTCALL, size_t_converter__doc__},
1258
1259 static PyObject *
1260 size_t_converter_impl(PyObject *module, size_t a);
1261
1262 static PyObject *
1263 size_t_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1264 {
1265 PyObject *return_value = NULL;
1266 size_t a = 12;
1267
1268 if (!_PyArg_CheckPositional("size_t_converter", nargs, 0, 1)) {
1269 goto exit;
1270 }
1271 if (nargs < 1) {
1272 goto skip_optional;
1273 }
1274 if (!_PyLong_Size_t_Converter(args[0], &a)) {
1275 goto exit;
1276 }
1277 skip_optional:
1278 return_value = size_t_converter_impl(module, a);
1279
1280 exit:
1281 return return_value;
1282 }
1283
1284 PyDoc_STRVAR(float_converter__doc__,
1285 "float_converter($module, a=12.5, /)\n"
1286 "--\n"
1287 "\n");
1288
1289 #define FLOAT_CONVERTER_METHODDEF \
1290 {"float_converter", _PyCFunction_CAST(float_converter), METH_FASTCALL, float_converter__doc__},
1291
1292 static PyObject *
1293 float_converter_impl(PyObject *module, float a);
1294
1295 static PyObject *
1296 float_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1297 {
1298 PyObject *return_value = NULL;
1299 float a = 12.5;
1300
1301 if (!_PyArg_CheckPositional("float_converter", nargs, 0, 1)) {
1302 goto exit;
1303 }
1304 if (nargs < 1) {
1305 goto skip_optional;
1306 }
1307 if (PyFloat_CheckExact(args[0])) {
1308 a = (float) (PyFloat_AS_DOUBLE(args[0]));
1309 }
1310 else
1311 {
1312 a = (float) PyFloat_AsDouble(args[0]);
1313 if (a == -1.0 && PyErr_Occurred()) {
1314 goto exit;
1315 }
1316 }
1317 skip_optional:
1318 return_value = float_converter_impl(module, a);
1319
1320 exit:
1321 return return_value;
1322 }
1323
1324 PyDoc_STRVAR(double_converter__doc__,
1325 "double_converter($module, a=12.5, /)\n"
1326 "--\n"
1327 "\n");
1328
1329 #define DOUBLE_CONVERTER_METHODDEF \
1330 {"double_converter", _PyCFunction_CAST(double_converter), METH_FASTCALL, double_converter__doc__},
1331
1332 static PyObject *
1333 double_converter_impl(PyObject *module, double a);
1334
1335 static PyObject *
1336 double_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1337 {
1338 PyObject *return_value = NULL;
1339 double a = 12.5;
1340
1341 if (!_PyArg_CheckPositional("double_converter", nargs, 0, 1)) {
1342 goto exit;
1343 }
1344 if (nargs < 1) {
1345 goto skip_optional;
1346 }
1347 if (PyFloat_CheckExact(args[0])) {
1348 a = PyFloat_AS_DOUBLE(args[0]);
1349 }
1350 else
1351 {
1352 a = PyFloat_AsDouble(args[0]);
1353 if (a == -1.0 && PyErr_Occurred()) {
1354 goto exit;
1355 }
1356 }
1357 skip_optional:
1358 return_value = double_converter_impl(module, a);
1359
1360 exit:
1361 return return_value;
1362 }
1363
1364 PyDoc_STRVAR(py_complex_converter__doc__,
1365 "py_complex_converter($module, a, /)\n"
1366 "--\n"
1367 "\n");
1368
1369 #define PY_COMPLEX_CONVERTER_METHODDEF \
1370 {"py_complex_converter", (PyCFunction)py_complex_converter, METH_O, py_complex_converter__doc__},
1371
1372 static PyObject *
1373 py_complex_converter_impl(PyObject *module, Py_complex a);
1374
1375 static PyObject *
1376 py_complex_converter(PyObject *module, PyObject *arg)
1377 {
1378 PyObject *return_value = NULL;
1379 Py_complex a;
1380
1381 a = PyComplex_AsCComplex(arg);
1382 if (PyErr_Occurred()) {
1383 goto exit;
1384 }
1385 return_value = py_complex_converter_impl(module, a);
1386
1387 exit:
1388 return return_value;
1389 }
1390
1391 PyDoc_STRVAR(str_converter__doc__,
1392 "str_converter($module, a=\'a\', b=\'b\', c=\'c\', /)\n"
1393 "--\n"
1394 "\n");
1395
1396 #define STR_CONVERTER_METHODDEF \
1397 {"str_converter", _PyCFunction_CAST(str_converter), METH_FASTCALL, str_converter__doc__},
1398
1399 static PyObject *
1400 str_converter_impl(PyObject *module, const char *a, const char *b,
1401 const char *c, Py_ssize_t c_length);
1402
1403 static PyObject *
1404 str_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1405 {
1406 PyObject *return_value = NULL;
1407 const char *a = "a";
1408 const char *b = "b";
1409 const char *c = "c";
1410 Py_ssize_t c_length;
1411
1412 if (!_PyArg_ParseStack(args, nargs, "|sys#:str_converter",
1413 &a, &b, &c, &c_length)) {
1414 goto exit;
1415 }
1416 return_value = str_converter_impl(module, a, b, c, c_length);
1417
1418 exit:
1419 return return_value;
1420 }
1421
1422 PyDoc_STRVAR(str_converter_encoding__doc__,
1423 "str_converter_encoding($module, a, b, c, /)\n"
1424 "--\n"
1425 "\n");
1426
1427 #define STR_CONVERTER_ENCODING_METHODDEF \
1428 {"str_converter_encoding", _PyCFunction_CAST(str_converter_encoding), METH_FASTCALL, str_converter_encoding__doc__},
1429
1430 static PyObject *
1431 str_converter_encoding_impl(PyObject *module, char *a, char *b, char *c,
1432 Py_ssize_t c_length);
1433
1434 static PyObject *
1435 str_converter_encoding(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1436 {
1437 PyObject *return_value = NULL;
1438 char *a = NULL;
1439 char *b = NULL;
1440 char *c = NULL;
1441 Py_ssize_t c_length;
1442
1443 if (!_PyArg_ParseStack(args, nargs, "esetet#:str_converter_encoding",
1444 "idna", &a, "idna", &b, "idna", &c, &c_length)) {
1445 goto exit;
1446 }
1447 return_value = str_converter_encoding_impl(module, a, b, c, c_length);
1448 /* Post parse cleanup for a */
1449 PyMem_FREE(a);
1450 /* Post parse cleanup for b */
1451 PyMem_FREE(b);
1452 /* Post parse cleanup for c */
1453 PyMem_FREE(c);
1454
1455 exit:
1456 return return_value;
1457 }
1458
1459 PyDoc_STRVAR(py_buffer_converter__doc__,
1460 "py_buffer_converter($module, a, b, /)\n"
1461 "--\n"
1462 "\n");
1463
1464 #define PY_BUFFER_CONVERTER_METHODDEF \
1465 {"py_buffer_converter", _PyCFunction_CAST(py_buffer_converter), METH_FASTCALL, py_buffer_converter__doc__},
1466
1467 static PyObject *
1468 py_buffer_converter_impl(PyObject *module, Py_buffer *a, Py_buffer *b);
1469
1470 static PyObject *
1471 py_buffer_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1472 {
1473 PyObject *return_value = NULL;
1474 Py_buffer a = {NULL, NULL};
1475 Py_buffer b = {NULL, NULL};
1476
1477 if (!_PyArg_ParseStack(args, nargs, "z*w*:py_buffer_converter",
1478 &a, &b)) {
1479 goto exit;
1480 }
1481 return_value = py_buffer_converter_impl(module, &a, &b);
1482
1483 exit:
1484 /* Cleanup for a */
1485 if (a.obj) {
1486 PyBuffer_Release(&a);
1487 }
1488 /* Cleanup for b */
1489 if (b.obj) {
1490 PyBuffer_Release(&b);
1491 }
1492
1493 return return_value;
1494 }
1495
1496 PyDoc_STRVAR(keywords__doc__,
1497 "keywords($module, /, a, b)\n"
1498 "--\n"
1499 "\n");
1500
1501 #define KEYWORDS_METHODDEF \
1502 {"keywords", _PyCFunction_CAST(keywords), METH_FASTCALL|METH_KEYWORDS, keywords__doc__},
1503
1504 static PyObject *
1505 keywords_impl(PyObject *module, PyObject *a, PyObject *b);
1506
1507 static PyObject *
1508 keywords(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1509 {
1510 PyObject *return_value = NULL;
1511 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1512
1513 #define NUM_KEYWORDS 2
1514 static struct {
1515 PyGC_Head _this_is_not_used;
1516 PyObject_VAR_HEAD
1517 Py_hash_t ob_hash;
1518 PyObject *ob_item[NUM_KEYWORDS];
1519 } _kwtuple = {
1520 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1521 .ob_hash = -1,
1522 .ob_item = { _Py_LATIN1_CHR('a'), _Py_LATIN1_CHR('b'), },
1523 };
1524 #undef NUM_KEYWORDS
1525 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1526
1527 #else // !Py_BUILD_CORE
1528 # define KWTUPLE NULL
1529 #endif // !Py_BUILD_CORE
1530
1531 static const char * const _keywords[] = {"a", "b", NULL};
1532 static _PyArg_Parser _parser = {
1533 .keywords = _keywords,
1534 .fname = "keywords",
1535 .kwtuple = KWTUPLE,
1536 };
1537 #undef KWTUPLE
1538 PyObject *argsbuf[2];
1539 PyObject *a;
1540 PyObject *b;
1541
1542 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
1543 /*minpos*/ 2, /*maxpos*/ 2, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
1544 if (!args) {
1545 goto exit;
1546 }
1547 a = args[0];
1548 b = args[1];
1549 return_value = keywords_impl(module, a, b);
1550
1551 exit:
1552 return return_value;
1553 }
1554
1555 PyDoc_STRVAR(keywords_kwonly__doc__,
1556 "keywords_kwonly($module, /, a, *, b)\n"
1557 "--\n"
1558 "\n");
1559
1560 #define KEYWORDS_KWONLY_METHODDEF \
1561 {"keywords_kwonly", _PyCFunction_CAST(keywords_kwonly), METH_FASTCALL|METH_KEYWORDS, keywords_kwonly__doc__},
1562
1563 static PyObject *
1564 keywords_kwonly_impl(PyObject *module, PyObject *a, PyObject *b);
1565
1566 static PyObject *
1567 keywords_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1568 {
1569 PyObject *return_value = NULL;
1570 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1571
1572 #define NUM_KEYWORDS 2
1573 static struct {
1574 PyGC_Head _this_is_not_used;
1575 PyObject_VAR_HEAD
1576 Py_hash_t ob_hash;
1577 PyObject *ob_item[NUM_KEYWORDS];
1578 } _kwtuple = {
1579 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1580 .ob_hash = -1,
1581 .ob_item = { _Py_LATIN1_CHR('a'), _Py_LATIN1_CHR('b'), },
1582 };
1583 #undef NUM_KEYWORDS
1584 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1585
1586 #else // !Py_BUILD_CORE
1587 # define KWTUPLE NULL
1588 #endif // !Py_BUILD_CORE
1589
1590 static const char * const _keywords[] = {"a", "b", NULL};
1591 static _PyArg_Parser _parser = {
1592 .keywords = _keywords,
1593 .fname = "keywords_kwonly",
1594 .kwtuple = KWTUPLE,
1595 };
1596 #undef KWTUPLE
1597 PyObject *argsbuf[2];
1598 PyObject *a;
1599 PyObject *b;
1600
1601 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
1602 /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 1, /*varpos*/ 0, argsbuf);
1603 if (!args) {
1604 goto exit;
1605 }
1606 a = args[0];
1607 b = args[1];
1608 return_value = keywords_kwonly_impl(module, a, b);
1609
1610 exit:
1611 return return_value;
1612 }
1613
1614 PyDoc_STRVAR(keywords_opt__doc__,
1615 "keywords_opt($module, /, a, b=None, c=None)\n"
1616 "--\n"
1617 "\n");
1618
1619 #define KEYWORDS_OPT_METHODDEF \
1620 {"keywords_opt", _PyCFunction_CAST(keywords_opt), METH_FASTCALL|METH_KEYWORDS, keywords_opt__doc__},
1621
1622 static PyObject *
1623 keywords_opt_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c);
1624
1625 static PyObject *
1626 keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1627 {
1628 PyObject *return_value = NULL;
1629 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1630
1631 #define NUM_KEYWORDS 3
1632 static struct {
1633 PyGC_Head _this_is_not_used;
1634 PyObject_VAR_HEAD
1635 Py_hash_t ob_hash;
1636 PyObject *ob_item[NUM_KEYWORDS];
1637 } _kwtuple = {
1638 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1639 .ob_hash = -1,
1640 .ob_item = { _Py_LATIN1_CHR('a'), _Py_LATIN1_CHR('b'), _Py_LATIN1_CHR('c'), },
1641 };
1642 #undef NUM_KEYWORDS
1643 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1644
1645 #else // !Py_BUILD_CORE
1646 # define KWTUPLE NULL
1647 #endif // !Py_BUILD_CORE
1648
1649 static const char * const _keywords[] = {"a", "b", "c", NULL};
1650 static _PyArg_Parser _parser = {
1651 .keywords = _keywords,
1652 .fname = "keywords_opt",
1653 .kwtuple = KWTUPLE,
1654 };
1655 #undef KWTUPLE
1656 PyObject *argsbuf[3];
1657 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
1658 PyObject *a;
1659 PyObject *b = Py_None;
1660 PyObject *c = Py_None;
1661
1662 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
1663 /*minpos*/ 1, /*maxpos*/ 3, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
1664 if (!args) {
1665 goto exit;
1666 }
1667 a = args[0];
1668 if (!noptargs) {
1669 goto skip_optional_pos;
1670 }
1671 if (args[1]) {
1672 b = args[1];
1673 if (!--noptargs) {
1674 goto skip_optional_pos;
1675 }
1676 }
1677 c = args[2];
1678 skip_optional_pos:
1679 return_value = keywords_opt_impl(module, a, b, c);
1680
1681 exit:
1682 return return_value;
1683 }
1684
1685 PyDoc_STRVAR(keywords_opt_kwonly__doc__,
1686 "keywords_opt_kwonly($module, /, a, b=None, *, c=None, d=None)\n"
1687 "--\n"
1688 "\n");
1689
1690 #define KEYWORDS_OPT_KWONLY_METHODDEF \
1691 {"keywords_opt_kwonly", _PyCFunction_CAST(keywords_opt_kwonly), METH_FASTCALL|METH_KEYWORDS, keywords_opt_kwonly__doc__},
1692
1693 static PyObject *
1694 keywords_opt_kwonly_impl(PyObject *module, PyObject *a, PyObject *b,
1695 PyObject *c, PyObject *d);
1696
1697 static PyObject *
1698 keywords_opt_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1699 {
1700 PyObject *return_value = NULL;
1701 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1702
1703 #define NUM_KEYWORDS 4
1704 static struct {
1705 PyGC_Head _this_is_not_used;
1706 PyObject_VAR_HEAD
1707 Py_hash_t ob_hash;
1708 PyObject *ob_item[NUM_KEYWORDS];
1709 } _kwtuple = {
1710 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1711 .ob_hash = -1,
1712 .ob_item = { _Py_LATIN1_CHR('a'), _Py_LATIN1_CHR('b'), _Py_LATIN1_CHR('c'), _Py_LATIN1_CHR('d'), },
1713 };
1714 #undef NUM_KEYWORDS
1715 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1716
1717 #else // !Py_BUILD_CORE
1718 # define KWTUPLE NULL
1719 #endif // !Py_BUILD_CORE
1720
1721 static const char * const _keywords[] = {"a", "b", "c", "d", NULL};
1722 static _PyArg_Parser _parser = {
1723 .keywords = _keywords,
1724 .fname = "keywords_opt_kwonly",
1725 .kwtuple = KWTUPLE,
1726 };
1727 #undef KWTUPLE
1728 PyObject *argsbuf[4];
1729 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
1730 PyObject *a;
1731 PyObject *b = Py_None;
1732 PyObject *c = Py_None;
1733 PyObject *d = Py_None;
1734
1735 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
1736 /*minpos*/ 1, /*maxpos*/ 2, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
1737 if (!args) {
1738 goto exit;
1739 }
1740 a = args[0];
1741 if (!noptargs) {
1742 goto skip_optional_pos;
1743 }
1744 if (args[1]) {
1745 b = args[1];
1746 if (!--noptargs) {
1747 goto skip_optional_pos;
1748 }
1749 }
1750 skip_optional_pos:
1751 if (!noptargs) {
1752 goto skip_optional_kwonly;
1753 }
1754 if (args[2]) {
1755 c = args[2];
1756 if (!--noptargs) {
1757 goto skip_optional_kwonly;
1758 }
1759 }
1760 d = args[3];
1761 skip_optional_kwonly:
1762 return_value = keywords_opt_kwonly_impl(module, a, b, c, d);
1763
1764 exit:
1765 return return_value;
1766 }
1767
1768 PyDoc_STRVAR(keywords_kwonly_opt__doc__,
1769 "keywords_kwonly_opt($module, /, a, *, b=None, c=None)\n"
1770 "--\n"
1771 "\n");
1772
1773 #define KEYWORDS_KWONLY_OPT_METHODDEF \
1774 {"keywords_kwonly_opt", _PyCFunction_CAST(keywords_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, keywords_kwonly_opt__doc__},
1775
1776 static PyObject *
1777 keywords_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
1778 PyObject *c);
1779
1780 static PyObject *
1781 keywords_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1782 {
1783 PyObject *return_value = NULL;
1784 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1785
1786 #define NUM_KEYWORDS 3
1787 static struct {
1788 PyGC_Head _this_is_not_used;
1789 PyObject_VAR_HEAD
1790 Py_hash_t ob_hash;
1791 PyObject *ob_item[NUM_KEYWORDS];
1792 } _kwtuple = {
1793 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1794 .ob_hash = -1,
1795 .ob_item = { _Py_LATIN1_CHR('a'), _Py_LATIN1_CHR('b'), _Py_LATIN1_CHR('c'), },
1796 };
1797 #undef NUM_KEYWORDS
1798 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1799
1800 #else // !Py_BUILD_CORE
1801 # define KWTUPLE NULL
1802 #endif // !Py_BUILD_CORE
1803
1804 static const char * const _keywords[] = {"a", "b", "c", NULL};
1805 static _PyArg_Parser _parser = {
1806 .keywords = _keywords,
1807 .fname = "keywords_kwonly_opt",
1808 .kwtuple = KWTUPLE,
1809 };
1810 #undef KWTUPLE
1811 PyObject *argsbuf[3];
1812 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
1813 PyObject *a;
1814 PyObject *b = Py_None;
1815 PyObject *c = Py_None;
1816
1817 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
1818 /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
1819 if (!args) {
1820 goto exit;
1821 }
1822 a = args[0];
1823 if (!noptargs) {
1824 goto skip_optional_kwonly;
1825 }
1826 if (args[1]) {
1827 b = args[1];
1828 if (!--noptargs) {
1829 goto skip_optional_kwonly;
1830 }
1831 }
1832 c = args[2];
1833 skip_optional_kwonly:
1834 return_value = keywords_kwonly_opt_impl(module, a, b, c);
1835
1836 exit:
1837 return return_value;
1838 }
1839
1840 PyDoc_STRVAR(posonly_keywords__doc__,
1841 "posonly_keywords($module, a, /, b)\n"
1842 "--\n"
1843 "\n");
1844
1845 #define POSONLY_KEYWORDS_METHODDEF \
1846 {"posonly_keywords", _PyCFunction_CAST(posonly_keywords), METH_FASTCALL|METH_KEYWORDS, posonly_keywords__doc__},
1847
1848 static PyObject *
1849 posonly_keywords_impl(PyObject *module, PyObject *a, PyObject *b);
1850
1851 static PyObject *
1852 posonly_keywords(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1853 {
1854 PyObject *return_value = NULL;
1855 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1856
1857 #define NUM_KEYWORDS 1
1858 static struct {
1859 PyGC_Head _this_is_not_used;
1860 PyObject_VAR_HEAD
1861 Py_hash_t ob_hash;
1862 PyObject *ob_item[NUM_KEYWORDS];
1863 } _kwtuple = {
1864 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1865 .ob_hash = -1,
1866 .ob_item = { _Py_LATIN1_CHR('b'), },
1867 };
1868 #undef NUM_KEYWORDS
1869 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1870
1871 #else // !Py_BUILD_CORE
1872 # define KWTUPLE NULL
1873 #endif // !Py_BUILD_CORE
1874
1875 static const char * const _keywords[] = {"", "b", NULL};
1876 static _PyArg_Parser _parser = {
1877 .keywords = _keywords,
1878 .fname = "posonly_keywords",
1879 .kwtuple = KWTUPLE,
1880 };
1881 #undef KWTUPLE
1882 PyObject *argsbuf[2];
1883 PyObject *a;
1884 PyObject *b;
1885
1886 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
1887 /*minpos*/ 2, /*maxpos*/ 2, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
1888 if (!args) {
1889 goto exit;
1890 }
1891 a = args[0];
1892 b = args[1];
1893 return_value = posonly_keywords_impl(module, a, b);
1894
1895 exit:
1896 return return_value;
1897 }
1898
1899 PyDoc_STRVAR(posonly_kwonly__doc__,
1900 "posonly_kwonly($module, a, /, *, b)\n"
1901 "--\n"
1902 "\n");
1903
1904 #define POSONLY_KWONLY_METHODDEF \
1905 {"posonly_kwonly", _PyCFunction_CAST(posonly_kwonly), METH_FASTCALL|METH_KEYWORDS, posonly_kwonly__doc__},
1906
1907 static PyObject *
1908 posonly_kwonly_impl(PyObject *module, PyObject *a, PyObject *b);
1909
1910 static PyObject *
1911 posonly_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1912 {
1913 PyObject *return_value = NULL;
1914 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1915
1916 #define NUM_KEYWORDS 1
1917 static struct {
1918 PyGC_Head _this_is_not_used;
1919 PyObject_VAR_HEAD
1920 Py_hash_t ob_hash;
1921 PyObject *ob_item[NUM_KEYWORDS];
1922 } _kwtuple = {
1923 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1924 .ob_hash = -1,
1925 .ob_item = { _Py_LATIN1_CHR('b'), },
1926 };
1927 #undef NUM_KEYWORDS
1928 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
1929
1930 #else // !Py_BUILD_CORE
1931 # define KWTUPLE NULL
1932 #endif // !Py_BUILD_CORE
1933
1934 static const char * const _keywords[] = {"", "b", NULL};
1935 static _PyArg_Parser _parser = {
1936 .keywords = _keywords,
1937 .fname = "posonly_kwonly",
1938 .kwtuple = KWTUPLE,
1939 };
1940 #undef KWTUPLE
1941 PyObject *argsbuf[2];
1942 PyObject *a;
1943 PyObject *b;
1944
1945 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
1946 /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 1, /*varpos*/ 0, argsbuf);
1947 if (!args) {
1948 goto exit;
1949 }
1950 a = args[0];
1951 b = args[1];
1952 return_value = posonly_kwonly_impl(module, a, b);
1953
1954 exit:
1955 return return_value;
1956 }
1957
1958 PyDoc_STRVAR(posonly_keywords_kwonly__doc__,
1959 "posonly_keywords_kwonly($module, a, /, b, *, c)\n"
1960 "--\n"
1961 "\n");
1962
1963 #define POSONLY_KEYWORDS_KWONLY_METHODDEF \
1964 {"posonly_keywords_kwonly", _PyCFunction_CAST(posonly_keywords_kwonly), METH_FASTCALL|METH_KEYWORDS, posonly_keywords_kwonly__doc__},
1965
1966 static PyObject *
1967 posonly_keywords_kwonly_impl(PyObject *module, PyObject *a, PyObject *b,
1968 PyObject *c);
1969
1970 static PyObject *
1971 posonly_keywords_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1972 {
1973 PyObject *return_value = NULL;
1974 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1975
1976 #define NUM_KEYWORDS 2
1977 static struct {
1978 PyGC_Head _this_is_not_used;
1979 PyObject_VAR_HEAD
1980 Py_hash_t ob_hash;
1981 PyObject *ob_item[NUM_KEYWORDS];
1982 } _kwtuple = {
1983 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
1984 .ob_hash = -1,
1985 .ob_item = { _Py_LATIN1_CHR('b'), _Py_LATIN1_CHR('c'), },
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[] = {"", "b", "c", NULL};
1995 static _PyArg_Parser _parser = {
1996 .keywords = _keywords,
1997 .fname = "posonly_keywords_kwonly",
1998 .kwtuple = KWTUPLE,
1999 };
2000 #undef KWTUPLE
2001 PyObject *argsbuf[3];
2002 PyObject *a;
2003 PyObject *b;
2004 PyObject *c;
2005
2006 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
2007 /*minpos*/ 2, /*maxpos*/ 2, /*minkw*/ 1, /*varpos*/ 0, argsbuf);
2008 if (!args) {
2009 goto exit;
2010 }
2011 a = args[0];
2012 b = args[1];
2013 c = args[2];
2014 return_value = posonly_keywords_kwonly_impl(module, a, b, c);
2015
2016 exit:
2017 return return_value;
2018 }
2019
2020 PyDoc_STRVAR(posonly_keywords_opt__doc__,
2021 "posonly_keywords_opt($module, a, /, b, c=None, d=None)\n"
2022 "--\n"
2023 "\n");
2024
2025 #define POSONLY_KEYWORDS_OPT_METHODDEF \
2026 {"posonly_keywords_opt", _PyCFunction_CAST(posonly_keywords_opt), METH_FASTCALL|METH_KEYWORDS, posonly_keywords_opt__doc__},
2027
2028 static PyObject *
2029 posonly_keywords_opt_impl(PyObject *module, PyObject *a, PyObject *b,
2030 PyObject *c, PyObject *d);
2031
2032 static PyObject *
2033 posonly_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2034 {
2035 PyObject *return_value = NULL;
2036 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2037
2038 #define NUM_KEYWORDS 3
2039 static struct {
2040 PyGC_Head _this_is_not_used;
2041 PyObject_VAR_HEAD
2042 Py_hash_t ob_hash;
2043 PyObject *ob_item[NUM_KEYWORDS];
2044 } _kwtuple = {
2045 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2046 .ob_hash = -1,
2047 .ob_item = { _Py_LATIN1_CHR('b'), _Py_LATIN1_CHR('c'), _Py_LATIN1_CHR('d'), },
2048 };
2049 #undef NUM_KEYWORDS
2050 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2051
2052 #else // !Py_BUILD_CORE
2053 # define KWTUPLE NULL
2054 #endif // !Py_BUILD_CORE
2055
2056 static const char * const _keywords[] = {"", "b", "c", "d", NULL};
2057 static _PyArg_Parser _parser = {
2058 .keywords = _keywords,
2059 .fname = "posonly_keywords_opt",
2060 .kwtuple = KWTUPLE,
2061 };
2062 #undef KWTUPLE
2063 PyObject *argsbuf[4];
2064 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
2065 PyObject *a;
2066 PyObject *b;
2067 PyObject *c = Py_None;
2068 PyObject *d = Py_None;
2069
2070 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
2071 /*minpos*/ 2, /*maxpos*/ 4, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
2072 if (!args) {
2073 goto exit;
2074 }
2075 a = args[0];
2076 b = args[1];
2077 if (!noptargs) {
2078 goto skip_optional_pos;
2079 }
2080 if (args[2]) {
2081 c = args[2];
2082 if (!--noptargs) {
2083 goto skip_optional_pos;
2084 }
2085 }
2086 d = args[3];
2087 skip_optional_pos:
2088 return_value = posonly_keywords_opt_impl(module, a, b, c, d);
2089
2090 exit:
2091 return return_value;
2092 }
2093
2094 PyDoc_STRVAR(posonly_opt_keywords_opt__doc__,
2095 "posonly_opt_keywords_opt($module, a, b=None, /, c=None, d=None)\n"
2096 "--\n"
2097 "\n");
2098
2099 #define POSONLY_OPT_KEYWORDS_OPT_METHODDEF \
2100 {"posonly_opt_keywords_opt", _PyCFunction_CAST(posonly_opt_keywords_opt), METH_FASTCALL|METH_KEYWORDS, posonly_opt_keywords_opt__doc__},
2101
2102 static PyObject *
2103 posonly_opt_keywords_opt_impl(PyObject *module, PyObject *a, PyObject *b,
2104 PyObject *c, PyObject *d);
2105
2106 static PyObject *
2107 posonly_opt_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2108 {
2109 PyObject *return_value = NULL;
2110 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2111
2112 #define NUM_KEYWORDS 2
2113 static struct {
2114 PyGC_Head _this_is_not_used;
2115 PyObject_VAR_HEAD
2116 Py_hash_t ob_hash;
2117 PyObject *ob_item[NUM_KEYWORDS];
2118 } _kwtuple = {
2119 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2120 .ob_hash = -1,
2121 .ob_item = { _Py_LATIN1_CHR('c'), _Py_LATIN1_CHR('d'), },
2122 };
2123 #undef NUM_KEYWORDS
2124 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2125
2126 #else // !Py_BUILD_CORE
2127 # define KWTUPLE NULL
2128 #endif // !Py_BUILD_CORE
2129
2130 static const char * const _keywords[] = {"", "", "c", "d", NULL};
2131 static _PyArg_Parser _parser = {
2132 .keywords = _keywords,
2133 .fname = "posonly_opt_keywords_opt",
2134 .kwtuple = KWTUPLE,
2135 };
2136 #undef KWTUPLE
2137 PyObject *argsbuf[4];
2138 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
2139 PyObject *a;
2140 PyObject *b = Py_None;
2141 PyObject *c = Py_None;
2142 PyObject *d = Py_None;
2143
2144 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
2145 /*minpos*/ 1, /*maxpos*/ 4, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
2146 if (!args) {
2147 goto exit;
2148 }
2149 a = args[0];
2150 if (nargs < 2) {
2151 goto skip_optional_posonly;
2152 }
2153 noptargs--;
2154 b = args[1];
2155 skip_optional_posonly:
2156 if (!noptargs) {
2157 goto skip_optional_pos;
2158 }
2159 if (args[2]) {
2160 c = args[2];
2161 if (!--noptargs) {
2162 goto skip_optional_pos;
2163 }
2164 }
2165 d = args[3];
2166 skip_optional_pos:
2167 return_value = posonly_opt_keywords_opt_impl(module, a, b, c, d);
2168
2169 exit:
2170 return return_value;
2171 }
2172
2173 PyDoc_STRVAR(posonly_kwonly_opt__doc__,
2174 "posonly_kwonly_opt($module, a, /, *, b, c=None, d=None)\n"
2175 "--\n"
2176 "\n");
2177
2178 #define POSONLY_KWONLY_OPT_METHODDEF \
2179 {"posonly_kwonly_opt", _PyCFunction_CAST(posonly_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, posonly_kwonly_opt__doc__},
2180
2181 static PyObject *
2182 posonly_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
2183 PyObject *c, PyObject *d);
2184
2185 static PyObject *
2186 posonly_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2187 {
2188 PyObject *return_value = NULL;
2189 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2190
2191 #define NUM_KEYWORDS 3
2192 static struct {
2193 PyGC_Head _this_is_not_used;
2194 PyObject_VAR_HEAD
2195 Py_hash_t ob_hash;
2196 PyObject *ob_item[NUM_KEYWORDS];
2197 } _kwtuple = {
2198 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2199 .ob_hash = -1,
2200 .ob_item = { _Py_LATIN1_CHR('b'), _Py_LATIN1_CHR('c'), _Py_LATIN1_CHR('d'), },
2201 };
2202 #undef NUM_KEYWORDS
2203 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2204
2205 #else // !Py_BUILD_CORE
2206 # define KWTUPLE NULL
2207 #endif // !Py_BUILD_CORE
2208
2209 static const char * const _keywords[] = {"", "b", "c", "d", NULL};
2210 static _PyArg_Parser _parser = {
2211 .keywords = _keywords,
2212 .fname = "posonly_kwonly_opt",
2213 .kwtuple = KWTUPLE,
2214 };
2215 #undef KWTUPLE
2216 PyObject *argsbuf[4];
2217 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
2218 PyObject *a;
2219 PyObject *b;
2220 PyObject *c = Py_None;
2221 PyObject *d = Py_None;
2222
2223 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
2224 /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 1, /*varpos*/ 0, argsbuf);
2225 if (!args) {
2226 goto exit;
2227 }
2228 a = args[0];
2229 b = args[1];
2230 if (!noptargs) {
2231 goto skip_optional_kwonly;
2232 }
2233 if (args[2]) {
2234 c = args[2];
2235 if (!--noptargs) {
2236 goto skip_optional_kwonly;
2237 }
2238 }
2239 d = args[3];
2240 skip_optional_kwonly:
2241 return_value = posonly_kwonly_opt_impl(module, a, b, c, d);
2242
2243 exit:
2244 return return_value;
2245 }
2246
2247 PyDoc_STRVAR(posonly_opt_kwonly_opt__doc__,
2248 "posonly_opt_kwonly_opt($module, a, b=None, /, *, c=None, d=None)\n"
2249 "--\n"
2250 "\n");
2251
2252 #define POSONLY_OPT_KWONLY_OPT_METHODDEF \
2253 {"posonly_opt_kwonly_opt", _PyCFunction_CAST(posonly_opt_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, posonly_opt_kwonly_opt__doc__},
2254
2255 static PyObject *
2256 posonly_opt_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
2257 PyObject *c, PyObject *d);
2258
2259 static PyObject *
2260 posonly_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2261 {
2262 PyObject *return_value = NULL;
2263 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2264
2265 #define NUM_KEYWORDS 2
2266 static struct {
2267 PyGC_Head _this_is_not_used;
2268 PyObject_VAR_HEAD
2269 Py_hash_t ob_hash;
2270 PyObject *ob_item[NUM_KEYWORDS];
2271 } _kwtuple = {
2272 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2273 .ob_hash = -1,
2274 .ob_item = { _Py_LATIN1_CHR('c'), _Py_LATIN1_CHR('d'), },
2275 };
2276 #undef NUM_KEYWORDS
2277 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2278
2279 #else // !Py_BUILD_CORE
2280 # define KWTUPLE NULL
2281 #endif // !Py_BUILD_CORE
2282
2283 static const char * const _keywords[] = {"", "", "c", "d", NULL};
2284 static _PyArg_Parser _parser = {
2285 .keywords = _keywords,
2286 .fname = "posonly_opt_kwonly_opt",
2287 .kwtuple = KWTUPLE,
2288 };
2289 #undef KWTUPLE
2290 PyObject *argsbuf[4];
2291 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
2292 PyObject *a;
2293 PyObject *b = Py_None;
2294 PyObject *c = Py_None;
2295 PyObject *d = Py_None;
2296
2297 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
2298 /*minpos*/ 1, /*maxpos*/ 2, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
2299 if (!args) {
2300 goto exit;
2301 }
2302 a = args[0];
2303 if (nargs < 2) {
2304 goto skip_optional_posonly;
2305 }
2306 noptargs--;
2307 b = args[1];
2308 skip_optional_posonly:
2309 if (!noptargs) {
2310 goto skip_optional_kwonly;
2311 }
2312 if (args[2]) {
2313 c = args[2];
2314 if (!--noptargs) {
2315 goto skip_optional_kwonly;
2316 }
2317 }
2318 d = args[3];
2319 skip_optional_kwonly:
2320 return_value = posonly_opt_kwonly_opt_impl(module, a, b, c, d);
2321
2322 exit:
2323 return return_value;
2324 }
2325
2326 PyDoc_STRVAR(posonly_keywords_kwonly_opt__doc__,
2327 "posonly_keywords_kwonly_opt($module, a, /, b, *, c, d=None, e=None)\n"
2328 "--\n"
2329 "\n");
2330
2331 #define POSONLY_KEYWORDS_KWONLY_OPT_METHODDEF \
2332 {"posonly_keywords_kwonly_opt", _PyCFunction_CAST(posonly_keywords_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, posonly_keywords_kwonly_opt__doc__},
2333
2334 static PyObject *
2335 posonly_keywords_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
2336 PyObject *c, PyObject *d, PyObject *e);
2337
2338 static PyObject *
2339 posonly_keywords_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2340 {
2341 PyObject *return_value = NULL;
2342 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2343
2344 #define NUM_KEYWORDS 4
2345 static struct {
2346 PyGC_Head _this_is_not_used;
2347 PyObject_VAR_HEAD
2348 Py_hash_t ob_hash;
2349 PyObject *ob_item[NUM_KEYWORDS];
2350 } _kwtuple = {
2351 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2352 .ob_hash = -1,
2353 .ob_item = { _Py_LATIN1_CHR('b'), _Py_LATIN1_CHR('c'), _Py_LATIN1_CHR('d'), _Py_LATIN1_CHR('e'), },
2354 };
2355 #undef NUM_KEYWORDS
2356 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2357
2358 #else // !Py_BUILD_CORE
2359 # define KWTUPLE NULL
2360 #endif // !Py_BUILD_CORE
2361
2362 static const char * const _keywords[] = {"", "b", "c", "d", "e", NULL};
2363 static _PyArg_Parser _parser = {
2364 .keywords = _keywords,
2365 .fname = "posonly_keywords_kwonly_opt",
2366 .kwtuple = KWTUPLE,
2367 };
2368 #undef KWTUPLE
2369 PyObject *argsbuf[5];
2370 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 3;
2371 PyObject *a;
2372 PyObject *b;
2373 PyObject *c;
2374 PyObject *d = Py_None;
2375 PyObject *e = Py_None;
2376
2377 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
2378 /*minpos*/ 2, /*maxpos*/ 2, /*minkw*/ 1, /*varpos*/ 0, argsbuf);
2379 if (!args) {
2380 goto exit;
2381 }
2382 a = args[0];
2383 b = args[1];
2384 c = args[2];
2385 if (!noptargs) {
2386 goto skip_optional_kwonly;
2387 }
2388 if (args[3]) {
2389 d = args[3];
2390 if (!--noptargs) {
2391 goto skip_optional_kwonly;
2392 }
2393 }
2394 e = args[4];
2395 skip_optional_kwonly:
2396 return_value = posonly_keywords_kwonly_opt_impl(module, a, b, c, d, e);
2397
2398 exit:
2399 return return_value;
2400 }
2401
2402 PyDoc_STRVAR(posonly_keywords_opt_kwonly_opt__doc__,
2403 "posonly_keywords_opt_kwonly_opt($module, a, /, b, c=None, *, d=None,\n"
2404 " e=None)\n"
2405 "--\n"
2406 "\n");
2407
2408 #define POSONLY_KEYWORDS_OPT_KWONLY_OPT_METHODDEF \
2409 {"posonly_keywords_opt_kwonly_opt", _PyCFunction_CAST(posonly_keywords_opt_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, posonly_keywords_opt_kwonly_opt__doc__},
2410
2411 static PyObject *
2412 posonly_keywords_opt_kwonly_opt_impl(PyObject *module, PyObject *a,
2413 PyObject *b, PyObject *c, PyObject *d,
2414 PyObject *e);
2415
2416 static PyObject *
2417 posonly_keywords_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2418 {
2419 PyObject *return_value = NULL;
2420 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2421
2422 #define NUM_KEYWORDS 4
2423 static struct {
2424 PyGC_Head _this_is_not_used;
2425 PyObject_VAR_HEAD
2426 Py_hash_t ob_hash;
2427 PyObject *ob_item[NUM_KEYWORDS];
2428 } _kwtuple = {
2429 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2430 .ob_hash = -1,
2431 .ob_item = { _Py_LATIN1_CHR('b'), _Py_LATIN1_CHR('c'), _Py_LATIN1_CHR('d'), _Py_LATIN1_CHR('e'), },
2432 };
2433 #undef NUM_KEYWORDS
2434 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2435
2436 #else // !Py_BUILD_CORE
2437 # define KWTUPLE NULL
2438 #endif // !Py_BUILD_CORE
2439
2440 static const char * const _keywords[] = {"", "b", "c", "d", "e", NULL};
2441 static _PyArg_Parser _parser = {
2442 .keywords = _keywords,
2443 .fname = "posonly_keywords_opt_kwonly_opt",
2444 .kwtuple = KWTUPLE,
2445 };
2446 #undef KWTUPLE
2447 PyObject *argsbuf[5];
2448 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
2449 PyObject *a;
2450 PyObject *b;
2451 PyObject *c = Py_None;
2452 PyObject *d = Py_None;
2453 PyObject *e = Py_None;
2454
2455 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
2456 /*minpos*/ 2, /*maxpos*/ 3, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
2457 if (!args) {
2458 goto exit;
2459 }
2460 a = args[0];
2461 b = args[1];
2462 if (!noptargs) {
2463 goto skip_optional_pos;
2464 }
2465 if (args[2]) {
2466 c = args[2];
2467 if (!--noptargs) {
2468 goto skip_optional_pos;
2469 }
2470 }
2471 skip_optional_pos:
2472 if (!noptargs) {
2473 goto skip_optional_kwonly;
2474 }
2475 if (args[3]) {
2476 d = args[3];
2477 if (!--noptargs) {
2478 goto skip_optional_kwonly;
2479 }
2480 }
2481 e = args[4];
2482 skip_optional_kwonly:
2483 return_value = posonly_keywords_opt_kwonly_opt_impl(module, a, b, c, d, e);
2484
2485 exit:
2486 return return_value;
2487 }
2488
2489 PyDoc_STRVAR(posonly_opt_keywords_opt_kwonly_opt__doc__,
2490 "posonly_opt_keywords_opt_kwonly_opt($module, a, b=None, /, c=None, *,\n"
2491 " d=None)\n"
2492 "--\n"
2493 "\n");
2494
2495 #define POSONLY_OPT_KEYWORDS_OPT_KWONLY_OPT_METHODDEF \
2496 {"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__},
2497
2498 static PyObject *
2499 posonly_opt_keywords_opt_kwonly_opt_impl(PyObject *module, PyObject *a,
2500 PyObject *b, PyObject *c,
2501 PyObject *d);
2502
2503 static PyObject *
2504 posonly_opt_keywords_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2505 {
2506 PyObject *return_value = NULL;
2507 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2508
2509 #define NUM_KEYWORDS 2
2510 static struct {
2511 PyGC_Head _this_is_not_used;
2512 PyObject_VAR_HEAD
2513 Py_hash_t ob_hash;
2514 PyObject *ob_item[NUM_KEYWORDS];
2515 } _kwtuple = {
2516 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2517 .ob_hash = -1,
2518 .ob_item = { _Py_LATIN1_CHR('c'), _Py_LATIN1_CHR('d'), },
2519 };
2520 #undef NUM_KEYWORDS
2521 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2522
2523 #else // !Py_BUILD_CORE
2524 # define KWTUPLE NULL
2525 #endif // !Py_BUILD_CORE
2526
2527 static const char * const _keywords[] = {"", "", "c", "d", NULL};
2528 static _PyArg_Parser _parser = {
2529 .keywords = _keywords,
2530 .fname = "posonly_opt_keywords_opt_kwonly_opt",
2531 .kwtuple = KWTUPLE,
2532 };
2533 #undef KWTUPLE
2534 PyObject *argsbuf[4];
2535 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
2536 PyObject *a;
2537 PyObject *b = Py_None;
2538 PyObject *c = Py_None;
2539 PyObject *d = Py_None;
2540
2541 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
2542 /*minpos*/ 1, /*maxpos*/ 3, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
2543 if (!args) {
2544 goto exit;
2545 }
2546 a = args[0];
2547 if (nargs < 2) {
2548 goto skip_optional_posonly;
2549 }
2550 noptargs--;
2551 b = args[1];
2552 skip_optional_posonly:
2553 if (!noptargs) {
2554 goto skip_optional_pos;
2555 }
2556 if (args[2]) {
2557 c = args[2];
2558 if (!--noptargs) {
2559 goto skip_optional_pos;
2560 }
2561 }
2562 skip_optional_pos:
2563 if (!noptargs) {
2564 goto skip_optional_kwonly;
2565 }
2566 d = args[3];
2567 skip_optional_kwonly:
2568 return_value = posonly_opt_keywords_opt_kwonly_opt_impl(module, a, b, c, d);
2569
2570 exit:
2571 return return_value;
2572 }
2573
2574 PyDoc_STRVAR(keyword_only_parameter__doc__,
2575 "keyword_only_parameter($module, /, *, a)\n"
2576 "--\n"
2577 "\n");
2578
2579 #define KEYWORD_ONLY_PARAMETER_METHODDEF \
2580 {"keyword_only_parameter", _PyCFunction_CAST(keyword_only_parameter), METH_FASTCALL|METH_KEYWORDS, keyword_only_parameter__doc__},
2581
2582 static PyObject *
2583 keyword_only_parameter_impl(PyObject *module, PyObject *a);
2584
2585 static PyObject *
2586 keyword_only_parameter(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2587 {
2588 PyObject *return_value = NULL;
2589 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2590
2591 #define NUM_KEYWORDS 1
2592 static struct {
2593 PyGC_Head _this_is_not_used;
2594 PyObject_VAR_HEAD
2595 Py_hash_t ob_hash;
2596 PyObject *ob_item[NUM_KEYWORDS];
2597 } _kwtuple = {
2598 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2599 .ob_hash = -1,
2600 .ob_item = { _Py_LATIN1_CHR('a'), },
2601 };
2602 #undef NUM_KEYWORDS
2603 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2604
2605 #else // !Py_BUILD_CORE
2606 # define KWTUPLE NULL
2607 #endif // !Py_BUILD_CORE
2608
2609 static const char * const _keywords[] = {"a", NULL};
2610 static _PyArg_Parser _parser = {
2611 .keywords = _keywords,
2612 .fname = "keyword_only_parameter",
2613 .kwtuple = KWTUPLE,
2614 };
2615 #undef KWTUPLE
2616 PyObject *argsbuf[1];
2617 PyObject *a;
2618
2619 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
2620 /*minpos*/ 0, /*maxpos*/ 0, /*minkw*/ 1, /*varpos*/ 0, argsbuf);
2621 if (!args) {
2622 goto exit;
2623 }
2624 a = args[0];
2625 return_value = keyword_only_parameter_impl(module, a);
2626
2627 exit:
2628 return return_value;
2629 }
2630
2631 PyDoc_STRVAR(varpos__doc__,
2632 "varpos($module, /, *args)\n"
2633 "--\n"
2634 "\n");
2635
2636 #define VARPOS_METHODDEF \
2637 {"varpos", _PyCFunction_CAST(varpos), METH_FASTCALL, varpos__doc__},
2638
2639 static PyObject *
2640 varpos_impl(PyObject *module, PyObject *args);
2641
2642 static PyObject *
2643 varpos(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
2644 {
2645 PyObject *return_value = NULL;
2646 PyObject *__clinic_args = NULL;
2647
2648 __clinic_args = _PyTuple_FromArray(args, nargs);
2649 if (__clinic_args == NULL) {
2650 goto exit;
2651 }
2652 return_value = varpos_impl(module, __clinic_args);
2653
2654 exit:
2655 /* Cleanup for args */
2656 Py_XDECREF(__clinic_args);
2657
2658 return return_value;
2659 }
2660
2661 PyDoc_STRVAR(posonly_varpos__doc__,
2662 "posonly_varpos($module, a, b, /, *args)\n"
2663 "--\n"
2664 "\n");
2665
2666 #define POSONLY_VARPOS_METHODDEF \
2667 {"posonly_varpos", _PyCFunction_CAST(posonly_varpos), METH_FASTCALL, posonly_varpos__doc__},
2668
2669 static PyObject *
2670 posonly_varpos_impl(PyObject *module, PyObject *a, PyObject *b,
2671 PyObject *args);
2672
2673 static PyObject *
2674 posonly_varpos(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
2675 {
2676 PyObject *return_value = NULL;
2677 PyObject *a;
2678 PyObject *b;
2679 PyObject *__clinic_args = NULL;
2680
2681 if (!_PyArg_CheckPositional("posonly_varpos", nargs, 2, PY_SSIZE_T_MAX)) {
2682 goto exit;
2683 }
2684 a = args[0];
2685 b = args[1];
2686 __clinic_args = _PyTuple_FromArray(args + 2, nargs - 2);
2687 if (__clinic_args == NULL) {
2688 goto exit;
2689 }
2690 return_value = posonly_varpos_impl(module, a, b, __clinic_args);
2691
2692 exit:
2693 /* Cleanup for args */
2694 Py_XDECREF(__clinic_args);
2695
2696 return return_value;
2697 }
2698
2699 PyDoc_STRVAR(posonly_req_opt_varpos__doc__,
2700 "posonly_req_opt_varpos($module, a, b=False, /, *args)\n"
2701 "--\n"
2702 "\n");
2703
2704 #define POSONLY_REQ_OPT_VARPOS_METHODDEF \
2705 {"posonly_req_opt_varpos", _PyCFunction_CAST(posonly_req_opt_varpos), METH_FASTCALL, posonly_req_opt_varpos__doc__},
2706
2707 static PyObject *
2708 posonly_req_opt_varpos_impl(PyObject *module, PyObject *a, PyObject *b,
2709 PyObject *args);
2710
2711 static PyObject *
2712 posonly_req_opt_varpos(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
2713 {
2714 PyObject *return_value = NULL;
2715 PyObject *a;
2716 PyObject *b = Py_False;
2717 PyObject *__clinic_args = NULL;
2718
2719 if (!_PyArg_CheckPositional("posonly_req_opt_varpos", nargs, 1, PY_SSIZE_T_MAX)) {
2720 goto exit;
2721 }
2722 a = args[0];
2723 if (nargs < 2) {
2724 goto skip_optional;
2725 }
2726 b = args[1];
2727 skip_optional:
2728 __clinic_args = nargs > 2
2729 ? _PyTuple_FromArray(args + 2, nargs - 2)
2730 : PyTuple_New(0);
2731 if (__clinic_args == NULL) {
2732 goto exit;
2733 }
2734 return_value = posonly_req_opt_varpos_impl(module, a, b, __clinic_args);
2735
2736 exit:
2737 /* Cleanup for args */
2738 Py_XDECREF(__clinic_args);
2739
2740 return return_value;
2741 }
2742
2743 PyDoc_STRVAR(posonly_poskw_varpos__doc__,
2744 "posonly_poskw_varpos($module, a, /, b, *args)\n"
2745 "--\n"
2746 "\n");
2747
2748 #define POSONLY_POSKW_VARPOS_METHODDEF \
2749 {"posonly_poskw_varpos", _PyCFunction_CAST(posonly_poskw_varpos), METH_FASTCALL|METH_KEYWORDS, posonly_poskw_varpos__doc__},
2750
2751 static PyObject *
2752 posonly_poskw_varpos_impl(PyObject *module, PyObject *a, PyObject *b,
2753 PyObject *args);
2754
2755 static PyObject *
2756 posonly_poskw_varpos(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2757 {
2758 PyObject *return_value = NULL;
2759 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2760
2761 #define NUM_KEYWORDS 1
2762 static struct {
2763 PyGC_Head _this_is_not_used;
2764 PyObject_VAR_HEAD
2765 Py_hash_t ob_hash;
2766 PyObject *ob_item[NUM_KEYWORDS];
2767 } _kwtuple = {
2768 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2769 .ob_hash = -1,
2770 .ob_item = { _Py_LATIN1_CHR('b'), },
2771 };
2772 #undef NUM_KEYWORDS
2773 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2774
2775 #else // !Py_BUILD_CORE
2776 # define KWTUPLE NULL
2777 #endif // !Py_BUILD_CORE
2778
2779 static const char * const _keywords[] = {"", "b", NULL};
2780 static _PyArg_Parser _parser = {
2781 .keywords = _keywords,
2782 .fname = "posonly_poskw_varpos",
2783 .kwtuple = KWTUPLE,
2784 };
2785 #undef KWTUPLE
2786 PyObject *argsbuf[2];
2787 PyObject * const *fastargs;
2788 PyObject *a;
2789 PyObject *b;
2790 PyObject *__clinic_args = NULL;
2791
2792 fastargs = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
2793 /*minpos*/ 2, /*maxpos*/ 2, /*minkw*/ 0, /*varpos*/ 1, argsbuf);
2794 if (!fastargs) {
2795 goto exit;
2796 }
2797 a = fastargs[0];
2798 b = fastargs[1];
2799 __clinic_args = nargs > 2
2800 ? _PyTuple_FromArray(args + 2, nargs - 2)
2801 : PyTuple_New(0);
2802 if (__clinic_args == NULL) {
2803 goto exit;
2804 }
2805 return_value = posonly_poskw_varpos_impl(module, a, b, __clinic_args);
2806
2807 exit:
2808 /* Cleanup for args */
2809 Py_XDECREF(__clinic_args);
2810
2811 return return_value;
2812 }
2813
2814 PyDoc_STRVAR(poskw_varpos__doc__,
2815 "poskw_varpos($module, /, a, *args)\n"
2816 "--\n"
2817 "\n");
2818
2819 #define POSKW_VARPOS_METHODDEF \
2820 {"poskw_varpos", _PyCFunction_CAST(poskw_varpos), METH_FASTCALL|METH_KEYWORDS, poskw_varpos__doc__},
2821
2822 static PyObject *
2823 poskw_varpos_impl(PyObject *module, PyObject *a, PyObject *args);
2824
2825 static PyObject *
2826 poskw_varpos(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2827 {
2828 PyObject *return_value = NULL;
2829 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2830
2831 #define NUM_KEYWORDS 1
2832 static struct {
2833 PyGC_Head _this_is_not_used;
2834 PyObject_VAR_HEAD
2835 Py_hash_t ob_hash;
2836 PyObject *ob_item[NUM_KEYWORDS];
2837 } _kwtuple = {
2838 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2839 .ob_hash = -1,
2840 .ob_item = { _Py_LATIN1_CHR('a'), },
2841 };
2842 #undef NUM_KEYWORDS
2843 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2844
2845 #else // !Py_BUILD_CORE
2846 # define KWTUPLE NULL
2847 #endif // !Py_BUILD_CORE
2848
2849 static const char * const _keywords[] = {"a", NULL};
2850 static _PyArg_Parser _parser = {
2851 .keywords = _keywords,
2852 .fname = "poskw_varpos",
2853 .kwtuple = KWTUPLE,
2854 };
2855 #undef KWTUPLE
2856 PyObject *argsbuf[1];
2857 PyObject * const *fastargs;
2858 PyObject *a;
2859 PyObject *__clinic_args = NULL;
2860
2861 fastargs = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
2862 /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 1, argsbuf);
2863 if (!fastargs) {
2864 goto exit;
2865 }
2866 a = fastargs[0];
2867 __clinic_args = nargs > 1
2868 ? _PyTuple_FromArray(args + 1, nargs - 1)
2869 : PyTuple_New(0);
2870 if (__clinic_args == NULL) {
2871 goto exit;
2872 }
2873 return_value = poskw_varpos_impl(module, a, __clinic_args);
2874
2875 exit:
2876 /* Cleanup for args */
2877 Py_XDECREF(__clinic_args);
2878
2879 return return_value;
2880 }
2881
2882 PyDoc_STRVAR(poskw_varpos_kwonly_opt__doc__,
2883 "poskw_varpos_kwonly_opt($module, /, a, *args, b=False)\n"
2884 "--\n"
2885 "\n");
2886
2887 #define POSKW_VARPOS_KWONLY_OPT_METHODDEF \
2888 {"poskw_varpos_kwonly_opt", _PyCFunction_CAST(poskw_varpos_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, poskw_varpos_kwonly_opt__doc__},
2889
2890 static PyObject *
2891 poskw_varpos_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *args,
2892 int b);
2893
2894 static PyObject *
2895 poskw_varpos_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2896 {
2897 PyObject *return_value = NULL;
2898 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2899
2900 #define NUM_KEYWORDS 2
2901 static struct {
2902 PyGC_Head _this_is_not_used;
2903 PyObject_VAR_HEAD
2904 Py_hash_t ob_hash;
2905 PyObject *ob_item[NUM_KEYWORDS];
2906 } _kwtuple = {
2907 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2908 .ob_hash = -1,
2909 .ob_item = { _Py_LATIN1_CHR('a'), _Py_LATIN1_CHR('b'), },
2910 };
2911 #undef NUM_KEYWORDS
2912 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2913
2914 #else // !Py_BUILD_CORE
2915 # define KWTUPLE NULL
2916 #endif // !Py_BUILD_CORE
2917
2918 static const char * const _keywords[] = {"a", "b", NULL};
2919 static _PyArg_Parser _parser = {
2920 .keywords = _keywords,
2921 .fname = "poskw_varpos_kwonly_opt",
2922 .kwtuple = KWTUPLE,
2923 };
2924 #undef KWTUPLE
2925 PyObject *argsbuf[2];
2926 PyObject * const *fastargs;
2927 Py_ssize_t noptargs = Py_MIN(nargs, 1) + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
2928 PyObject *a;
2929 PyObject *__clinic_args = NULL;
2930 int b = 0;
2931
2932 fastargs = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
2933 /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 1, argsbuf);
2934 if (!fastargs) {
2935 goto exit;
2936 }
2937 a = fastargs[0];
2938 if (!noptargs) {
2939 goto skip_optional_kwonly;
2940 }
2941 b = PyObject_IsTrue(fastargs[1]);
2942 if (b < 0) {
2943 goto exit;
2944 }
2945 skip_optional_kwonly:
2946 __clinic_args = nargs > 1
2947 ? _PyTuple_FromArray(args + 1, nargs - 1)
2948 : PyTuple_New(0);
2949 if (__clinic_args == NULL) {
2950 goto exit;
2951 }
2952 return_value = poskw_varpos_kwonly_opt_impl(module, a, __clinic_args, b);
2953
2954 exit:
2955 /* Cleanup for args */
2956 Py_XDECREF(__clinic_args);
2957
2958 return return_value;
2959 }
2960
2961 PyDoc_STRVAR(poskw_varpos_kwonly_opt2__doc__,
2962 "poskw_varpos_kwonly_opt2($module, /, a, *args, b=False, c=False)\n"
2963 "--\n"
2964 "\n");
2965
2966 #define POSKW_VARPOS_KWONLY_OPT2_METHODDEF \
2967 {"poskw_varpos_kwonly_opt2", _PyCFunction_CAST(poskw_varpos_kwonly_opt2), METH_FASTCALL|METH_KEYWORDS, poskw_varpos_kwonly_opt2__doc__},
2968
2969 static PyObject *
2970 poskw_varpos_kwonly_opt2_impl(PyObject *module, PyObject *a, PyObject *args,
2971 PyObject *b, PyObject *c);
2972
2973 static PyObject *
2974 poskw_varpos_kwonly_opt2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2975 {
2976 PyObject *return_value = NULL;
2977 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
2978
2979 #define NUM_KEYWORDS 3
2980 static struct {
2981 PyGC_Head _this_is_not_used;
2982 PyObject_VAR_HEAD
2983 Py_hash_t ob_hash;
2984 PyObject *ob_item[NUM_KEYWORDS];
2985 } _kwtuple = {
2986 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
2987 .ob_hash = -1,
2988 .ob_item = { _Py_LATIN1_CHR('a'), _Py_LATIN1_CHR('b'), _Py_LATIN1_CHR('c'), },
2989 };
2990 #undef NUM_KEYWORDS
2991 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
2992
2993 #else // !Py_BUILD_CORE
2994 # define KWTUPLE NULL
2995 #endif // !Py_BUILD_CORE
2996
2997 static const char * const _keywords[] = {"a", "b", "c", NULL};
2998 static _PyArg_Parser _parser = {
2999 .keywords = _keywords,
3000 .fname = "poskw_varpos_kwonly_opt2",
3001 .kwtuple = KWTUPLE,
3002 };
3003 #undef KWTUPLE
3004 PyObject *argsbuf[3];
3005 PyObject * const *fastargs;
3006 Py_ssize_t noptargs = Py_MIN(nargs, 1) + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
3007 PyObject *a;
3008 PyObject *__clinic_args = NULL;
3009 PyObject *b = Py_False;
3010 PyObject *c = Py_False;
3011
3012 fastargs = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
3013 /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 1, argsbuf);
3014 if (!fastargs) {
3015 goto exit;
3016 }
3017 a = fastargs[0];
3018 if (!noptargs) {
3019 goto skip_optional_kwonly;
3020 }
3021 if (fastargs[1]) {
3022 b = fastargs[1];
3023 if (!--noptargs) {
3024 goto skip_optional_kwonly;
3025 }
3026 }
3027 c = fastargs[2];
3028 skip_optional_kwonly:
3029 __clinic_args = nargs > 1
3030 ? _PyTuple_FromArray(args + 1, nargs - 1)
3031 : PyTuple_New(0);
3032 if (__clinic_args == NULL) {
3033 goto exit;
3034 }
3035 return_value = poskw_varpos_kwonly_opt2_impl(module, a, __clinic_args, b, c);
3036
3037 exit:
3038 /* Cleanup for args */
3039 Py_XDECREF(__clinic_args);
3040
3041 return return_value;
3042 }
3043
3044 PyDoc_STRVAR(varpos_kwonly_opt__doc__,
3045 "varpos_kwonly_opt($module, /, *args, b=False)\n"
3046 "--\n"
3047 "\n");
3048
3049 #define VARPOS_KWONLY_OPT_METHODDEF \
3050 {"varpos_kwonly_opt", _PyCFunction_CAST(varpos_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, varpos_kwonly_opt__doc__},
3051
3052 static PyObject *
3053 varpos_kwonly_opt_impl(PyObject *module, PyObject *args, PyObject *b);
3054
3055 static PyObject *
3056 varpos_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
3057 {
3058 PyObject *return_value = NULL;
3059 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
3060
3061 #define NUM_KEYWORDS 1
3062 static struct {
3063 PyGC_Head _this_is_not_used;
3064 PyObject_VAR_HEAD
3065 Py_hash_t ob_hash;
3066 PyObject *ob_item[NUM_KEYWORDS];
3067 } _kwtuple = {
3068 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
3069 .ob_hash = -1,
3070 .ob_item = { _Py_LATIN1_CHR('b'), },
3071 };
3072 #undef NUM_KEYWORDS
3073 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
3074
3075 #else // !Py_BUILD_CORE
3076 # define KWTUPLE NULL
3077 #endif // !Py_BUILD_CORE
3078
3079 static const char * const _keywords[] = {"b", NULL};
3080 static _PyArg_Parser _parser = {
3081 .keywords = _keywords,
3082 .fname = "varpos_kwonly_opt",
3083 .kwtuple = KWTUPLE,
3084 };
3085 #undef KWTUPLE
3086 PyObject *argsbuf[1];
3087 PyObject * const *fastargs;
3088 Py_ssize_t noptargs = 0 + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
3089 PyObject *__clinic_args = NULL;
3090 PyObject *b = Py_False;
3091
3092 fastargs = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
3093 /*minpos*/ 0, /*maxpos*/ 0, /*minkw*/ 0, /*varpos*/ 1, argsbuf);
3094 if (!fastargs) {
3095 goto exit;
3096 }
3097 if (!noptargs) {
3098 goto skip_optional_kwonly;
3099 }
3100 b = fastargs[0];
3101 skip_optional_kwonly:
3102 __clinic_args = _PyTuple_FromArray(args, nargs);
3103 if (__clinic_args == NULL) {
3104 goto exit;
3105 }
3106 return_value = varpos_kwonly_opt_impl(module, __clinic_args, b);
3107
3108 exit:
3109 /* Cleanup for args */
3110 Py_XDECREF(__clinic_args);
3111
3112 return return_value;
3113 }
3114
3115 PyDoc_STRVAR(varpos_kwonly_req_opt__doc__,
3116 "varpos_kwonly_req_opt($module, /, *args, a, b=False, c=False)\n"
3117 "--\n"
3118 "\n");
3119
3120 #define VARPOS_KWONLY_REQ_OPT_METHODDEF \
3121 {"varpos_kwonly_req_opt", _PyCFunction_CAST(varpos_kwonly_req_opt), METH_FASTCALL|METH_KEYWORDS, varpos_kwonly_req_opt__doc__},
3122
3123 static PyObject *
3124 varpos_kwonly_req_opt_impl(PyObject *module, PyObject *args, PyObject *a,
3125 PyObject *b, PyObject *c);
3126
3127 static PyObject *
3128 varpos_kwonly_req_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
3129 {
3130 PyObject *return_value = NULL;
3131 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
3132
3133 #define NUM_KEYWORDS 3
3134 static struct {
3135 PyGC_Head _this_is_not_used;
3136 PyObject_VAR_HEAD
3137 Py_hash_t ob_hash;
3138 PyObject *ob_item[NUM_KEYWORDS];
3139 } _kwtuple = {
3140 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
3141 .ob_hash = -1,
3142 .ob_item = { _Py_LATIN1_CHR('a'), _Py_LATIN1_CHR('b'), _Py_LATIN1_CHR('c'), },
3143 };
3144 #undef NUM_KEYWORDS
3145 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
3146
3147 #else // !Py_BUILD_CORE
3148 # define KWTUPLE NULL
3149 #endif // !Py_BUILD_CORE
3150
3151 static const char * const _keywords[] = {"a", "b", "c", NULL};
3152 static _PyArg_Parser _parser = {
3153 .keywords = _keywords,
3154 .fname = "varpos_kwonly_req_opt",
3155 .kwtuple = KWTUPLE,
3156 };
3157 #undef KWTUPLE
3158 PyObject *argsbuf[3];
3159 PyObject * const *fastargs;
3160 Py_ssize_t noptargs = 0 + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
3161 PyObject *__clinic_args = NULL;
3162 PyObject *a;
3163 PyObject *b = Py_False;
3164 PyObject *c = Py_False;
3165
3166 fastargs = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
3167 /*minpos*/ 0, /*maxpos*/ 0, /*minkw*/ 1, /*varpos*/ 1, argsbuf);
3168 if (!fastargs) {
3169 goto exit;
3170 }
3171 a = fastargs[0];
3172 if (!noptargs) {
3173 goto skip_optional_kwonly;
3174 }
3175 if (fastargs[1]) {
3176 b = fastargs[1];
3177 if (!--noptargs) {
3178 goto skip_optional_kwonly;
3179 }
3180 }
3181 c = fastargs[2];
3182 skip_optional_kwonly:
3183 __clinic_args = _PyTuple_FromArray(args, nargs);
3184 if (__clinic_args == NULL) {
3185 goto exit;
3186 }
3187 return_value = varpos_kwonly_req_opt_impl(module, __clinic_args, a, b, c);
3188
3189 exit:
3190 /* Cleanup for args */
3191 Py_XDECREF(__clinic_args);
3192
3193 return return_value;
3194 }
3195
3196 PyDoc_STRVAR(varpos_array__doc__,
3197 "varpos_array($module, /, *args)\n"
3198 "--\n"
3199 "\n");
3200
3201 #define VARPOS_ARRAY_METHODDEF \
3202 {"varpos_array", _PyCFunction_CAST(varpos_array), METH_FASTCALL, varpos_array__doc__},
3203
3204 static PyObject *
3205 varpos_array_impl(PyObject *module, PyObject * const *args,
3206 Py_ssize_t args_length);
3207
3208 static PyObject *
3209 varpos_array(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
3210 {
3211 PyObject *return_value = NULL;
3212 PyObject * const *__clinic_args;
3213 Py_ssize_t args_length;
3214
3215 __clinic_args = args;
3216 args_length = nargs;
3217 return_value = varpos_array_impl(module, __clinic_args, args_length);
3218
3219 return return_value;
3220 }
3221
3222 PyDoc_STRVAR(posonly_varpos_array__doc__,
3223 "posonly_varpos_array($module, a, b, /, *args)\n"
3224 "--\n"
3225 "\n");
3226
3227 #define POSONLY_VARPOS_ARRAY_METHODDEF \
3228 {"posonly_varpos_array", _PyCFunction_CAST(posonly_varpos_array), METH_FASTCALL, posonly_varpos_array__doc__},
3229
3230 static PyObject *
3231 posonly_varpos_array_impl(PyObject *module, PyObject *a, PyObject *b,
3232 PyObject * const *args, Py_ssize_t args_length);
3233
3234 static PyObject *
3235 posonly_varpos_array(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
3236 {
3237 PyObject *return_value = NULL;
3238 PyObject *a;
3239 PyObject *b;
3240 PyObject * const *__clinic_args;
3241 Py_ssize_t args_length;
3242
3243 if (!_PyArg_CheckPositional("posonly_varpos_array", nargs, 2, PY_SSIZE_T_MAX)) {
3244 goto exit;
3245 }
3246 a = args[0];
3247 b = args[1];
3248 __clinic_args = args + 2;
3249 args_length = nargs - 2;
3250 return_value = posonly_varpos_array_impl(module, a, b, __clinic_args, args_length);
3251
3252 exit:
3253 return return_value;
3254 }
3255
3256 PyDoc_STRVAR(posonly_req_opt_varpos_array__doc__,
3257 "posonly_req_opt_varpos_array($module, a, b=False, /, *args)\n"
3258 "--\n"
3259 "\n");
3260
3261 #define POSONLY_REQ_OPT_VARPOS_ARRAY_METHODDEF \
3262 {"posonly_req_opt_varpos_array", _PyCFunction_CAST(posonly_req_opt_varpos_array), METH_FASTCALL, posonly_req_opt_varpos_array__doc__},
3263
3264 static PyObject *
3265 posonly_req_opt_varpos_array_impl(PyObject *module, PyObject *a, PyObject *b,
3266 PyObject * const *args,
3267 Py_ssize_t args_length);
3268
3269 static PyObject *
3270 posonly_req_opt_varpos_array(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
3271 {
3272 PyObject *return_value = NULL;
3273 PyObject *a;
3274 PyObject *b = Py_False;
3275 PyObject * const *__clinic_args;
3276 Py_ssize_t args_length;
3277
3278 if (!_PyArg_CheckPositional("posonly_req_opt_varpos_array", nargs, 1, PY_SSIZE_T_MAX)) {
3279 goto exit;
3280 }
3281 a = args[0];
3282 if (nargs < 2) {
3283 goto skip_optional;
3284 }
3285 b = args[1];
3286 skip_optional:
3287 __clinic_args = nargs > 2 ? args + 2 : args;
3288 args_length = Py_MAX(0, nargs - 2);
3289 return_value = posonly_req_opt_varpos_array_impl(module, a, b, __clinic_args, args_length);
3290
3291 exit:
3292 return return_value;
3293 }
3294
3295 PyDoc_STRVAR(posonly_poskw_varpos_array__doc__,
3296 "posonly_poskw_varpos_array($module, a, /, b, *args)\n"
3297 "--\n"
3298 "\n");
3299
3300 #define POSONLY_POSKW_VARPOS_ARRAY_METHODDEF \
3301 {"posonly_poskw_varpos_array", _PyCFunction_CAST(posonly_poskw_varpos_array), METH_FASTCALL|METH_KEYWORDS, posonly_poskw_varpos_array__doc__},
3302
3303 static PyObject *
3304 posonly_poskw_varpos_array_impl(PyObject *module, PyObject *a, PyObject *b,
3305 PyObject * const *args,
3306 Py_ssize_t args_length);
3307
3308 static PyObject *
3309 posonly_poskw_varpos_array(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
3310 {
3311 PyObject *return_value = NULL;
3312 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
3313
3314 #define NUM_KEYWORDS 1
3315 static struct {
3316 PyGC_Head _this_is_not_used;
3317 PyObject_VAR_HEAD
3318 Py_hash_t ob_hash;
3319 PyObject *ob_item[NUM_KEYWORDS];
3320 } _kwtuple = {
3321 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
3322 .ob_hash = -1,
3323 .ob_item = { _Py_LATIN1_CHR('b'), },
3324 };
3325 #undef NUM_KEYWORDS
3326 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
3327
3328 #else // !Py_BUILD_CORE
3329 # define KWTUPLE NULL
3330 #endif // !Py_BUILD_CORE
3331
3332 static const char * const _keywords[] = {"", "b", NULL};
3333 static _PyArg_Parser _parser = {
3334 .keywords = _keywords,
3335 .fname = "posonly_poskw_varpos_array",
3336 .kwtuple = KWTUPLE,
3337 };
3338 #undef KWTUPLE
3339 PyObject *argsbuf[2];
3340 PyObject * const *fastargs;
3341 PyObject *a;
3342 PyObject *b;
3343 PyObject * const *__clinic_args;
3344 Py_ssize_t args_length;
3345
3346 fastargs = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
3347 /*minpos*/ 2, /*maxpos*/ 2, /*minkw*/ 0, /*varpos*/ 1, argsbuf);
3348 if (!fastargs) {
3349 goto exit;
3350 }
3351 a = fastargs[0];
3352 b = fastargs[1];
3353 __clinic_args = nargs > 2 ? args + 2 : args;
3354 args_length = Py_MAX(0, nargs - 2);
3355 return_value = posonly_poskw_varpos_array_impl(module, a, b, __clinic_args, args_length);
3356
3357 exit:
3358 return return_value;
3359 }
3360
3361 PyDoc_STRVAR(gh_32092_oob__doc__,
3362 "gh_32092_oob($module, /, pos1, pos2, *varargs, kw1=None, kw2=None)\n"
3363 "--\n"
3364 "\n"
3365 "Proof-of-concept of GH-32092 OOB bug.");
3366
3367 #define GH_32092_OOB_METHODDEF \
3368 {"gh_32092_oob", _PyCFunction_CAST(gh_32092_oob), METH_FASTCALL|METH_KEYWORDS, gh_32092_oob__doc__},
3369
3370 static PyObject *
3371 gh_32092_oob_impl(PyObject *module, PyObject *pos1, PyObject *pos2,
3372 PyObject *varargs, PyObject *kw1, PyObject *kw2);
3373
3374 static PyObject *
3375 gh_32092_oob(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
3376 {
3377 PyObject *return_value = NULL;
3378 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
3379
3380 #define NUM_KEYWORDS 4
3381 static struct {
3382 PyGC_Head _this_is_not_used;
3383 PyObject_VAR_HEAD
3384 Py_hash_t ob_hash;
3385 PyObject *ob_item[NUM_KEYWORDS];
3386 } _kwtuple = {
3387 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
3388 .ob_hash = -1,
3389 .ob_item = { &_Py_ID(pos1), &_Py_ID(pos2), &_Py_ID(kw1), &_Py_ID(kw2), },
3390 };
3391 #undef NUM_KEYWORDS
3392 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
3393
3394 #else // !Py_BUILD_CORE
3395 # define KWTUPLE NULL
3396 #endif // !Py_BUILD_CORE
3397
3398 static const char * const _keywords[] = {"pos1", "pos2", "kw1", "kw2", NULL};
3399 static _PyArg_Parser _parser = {
3400 .keywords = _keywords,
3401 .fname = "gh_32092_oob",
3402 .kwtuple = KWTUPLE,
3403 };
3404 #undef KWTUPLE
3405 PyObject *argsbuf[4];
3406 PyObject * const *fastargs;
3407 Py_ssize_t noptargs = Py_MIN(nargs, 2) + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
3408 PyObject *pos1;
3409 PyObject *pos2;
3410 PyObject *varargs = NULL;
3411 PyObject *kw1 = Py_None;
3412 PyObject *kw2 = Py_None;
3413
3414 fastargs = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
3415 /*minpos*/ 2, /*maxpos*/ 2, /*minkw*/ 0, /*varpos*/ 1, argsbuf);
3416 if (!fastargs) {
3417 goto exit;
3418 }
3419 pos1 = fastargs[0];
3420 pos2 = fastargs[1];
3421 if (!noptargs) {
3422 goto skip_optional_kwonly;
3423 }
3424 if (fastargs[2]) {
3425 kw1 = fastargs[2];
3426 if (!--noptargs) {
3427 goto skip_optional_kwonly;
3428 }
3429 }
3430 kw2 = fastargs[3];
3431 skip_optional_kwonly:
3432 varargs = nargs > 2
3433 ? _PyTuple_FromArray(args + 2, nargs - 2)
3434 : PyTuple_New(0);
3435 if (varargs == NULL) {
3436 goto exit;
3437 }
3438 return_value = gh_32092_oob_impl(module, pos1, pos2, varargs, kw1, kw2);
3439
3440 exit:
3441 /* Cleanup for varargs */
3442 Py_XDECREF(varargs);
3443
3444 return return_value;
3445 }
3446
3447 PyDoc_STRVAR(gh_32092_kw_pass__doc__,
3448 "gh_32092_kw_pass($module, /, pos, *args, kw=None)\n"
3449 "--\n"
3450 "\n"
3451 "Proof-of-concept of GH-32092 keyword args passing bug.");
3452
3453 #define GH_32092_KW_PASS_METHODDEF \
3454 {"gh_32092_kw_pass", _PyCFunction_CAST(gh_32092_kw_pass), METH_FASTCALL|METH_KEYWORDS, gh_32092_kw_pass__doc__},
3455
3456 static PyObject *
3457 gh_32092_kw_pass_impl(PyObject *module, PyObject *pos, PyObject *args,
3458 PyObject *kw);
3459
3460 static PyObject *
3461 gh_32092_kw_pass(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
3462 {
3463 PyObject *return_value = NULL;
3464 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
3465
3466 #define NUM_KEYWORDS 2
3467 static struct {
3468 PyGC_Head _this_is_not_used;
3469 PyObject_VAR_HEAD
3470 Py_hash_t ob_hash;
3471 PyObject *ob_item[NUM_KEYWORDS];
3472 } _kwtuple = {
3473 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
3474 .ob_hash = -1,
3475 .ob_item = { &_Py_ID(pos), &_Py_ID(kw), },
3476 };
3477 #undef NUM_KEYWORDS
3478 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
3479
3480 #else // !Py_BUILD_CORE
3481 # define KWTUPLE NULL
3482 #endif // !Py_BUILD_CORE
3483
3484 static const char * const _keywords[] = {"pos", "kw", NULL};
3485 static _PyArg_Parser _parser = {
3486 .keywords = _keywords,
3487 .fname = "gh_32092_kw_pass",
3488 .kwtuple = KWTUPLE,
3489 };
3490 #undef KWTUPLE
3491 PyObject *argsbuf[2];
3492 PyObject * const *fastargs;
3493 Py_ssize_t noptargs = Py_MIN(nargs, 1) + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
3494 PyObject *pos;
3495 PyObject *__clinic_args = NULL;
3496 PyObject *kw = Py_None;
3497
3498 fastargs = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
3499 /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 1, argsbuf);
3500 if (!fastargs) {
3501 goto exit;
3502 }
3503 pos = fastargs[0];
3504 if (!noptargs) {
3505 goto skip_optional_kwonly;
3506 }
3507 kw = fastargs[1];
3508 skip_optional_kwonly:
3509 __clinic_args = nargs > 1
3510 ? _PyTuple_FromArray(args + 1, nargs - 1)
3511 : PyTuple_New(0);
3512 if (__clinic_args == NULL) {
3513 goto exit;
3514 }
3515 return_value = gh_32092_kw_pass_impl(module, pos, __clinic_args, kw);
3516
3517 exit:
3518 /* Cleanup for args */
3519 Py_XDECREF(__clinic_args);
3520
3521 return return_value;
3522 }
3523
3524 PyDoc_STRVAR(gh_99233_refcount__doc__,
3525 "gh_99233_refcount($module, /, *args)\n"
3526 "--\n"
3527 "\n"
3528 "Proof-of-concept of GH-99233 refcount error bug.");
3529
3530 #define GH_99233_REFCOUNT_METHODDEF \
3531 {"gh_99233_refcount", _PyCFunction_CAST(gh_99233_refcount), METH_FASTCALL, gh_99233_refcount__doc__},
3532
3533 static PyObject *
3534 gh_99233_refcount_impl(PyObject *module, PyObject *args);
3535
3536 static PyObject *
3537 gh_99233_refcount(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
3538 {
3539 PyObject *return_value = NULL;
3540 PyObject *__clinic_args = NULL;
3541
3542 __clinic_args = _PyTuple_FromArray(args, nargs);
3543 if (__clinic_args == NULL) {
3544 goto exit;
3545 }
3546 return_value = gh_99233_refcount_impl(module, __clinic_args);
3547
3548 exit:
3549 /* Cleanup for args */
3550 Py_XDECREF(__clinic_args);
3551
3552 return return_value;
3553 }
3554
3555 PyDoc_STRVAR(gh_99240_double_free__doc__,
3556 "gh_99240_double_free($module, a, b, /)\n"
3557 "--\n"
3558 "\n"
3559 "Proof-of-concept of GH-99240 double-free bug.");
3560
3561 #define GH_99240_DOUBLE_FREE_METHODDEF \
3562 {"gh_99240_double_free", _PyCFunction_CAST(gh_99240_double_free), METH_FASTCALL, gh_99240_double_free__doc__},
3563
3564 static PyObject *
3565 gh_99240_double_free_impl(PyObject *module, char *a, char *b);
3566
3567 static PyObject *
3568 gh_99240_double_free(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
3569 {
3570 PyObject *return_value = NULL;
3571 char *a = NULL;
3572 char *b = NULL;
3573
3574 if (!_PyArg_ParseStack(args, nargs, "eses:gh_99240_double_free",
3575 "idna", &a, "idna", &b)) {
3576 goto exit;
3577 }
3578 return_value = gh_99240_double_free_impl(module, a, b);
3579 /* Post parse cleanup for a */
3580 PyMem_FREE(a);
3581 /* Post parse cleanup for b */
3582 PyMem_FREE(b);
3583
3584 exit:
3585 return return_value;
3586 }
3587
3588 PyDoc_STRVAR(null_or_tuple_for_varargs__doc__,
3589 "null_or_tuple_for_varargs($module, /, name, *constraints,\n"
3590 " covariant=False)\n"
3591 "--\n"
3592 "\n"
3593 "See https://github.com/python/cpython/issues/110864");
3594
3595 #define NULL_OR_TUPLE_FOR_VARARGS_METHODDEF \
3596 {"null_or_tuple_for_varargs", _PyCFunction_CAST(null_or_tuple_for_varargs), METH_FASTCALL|METH_KEYWORDS, null_or_tuple_for_varargs__doc__},
3597
3598 static PyObject *
3599 null_or_tuple_for_varargs_impl(PyObject *module, PyObject *name,
3600 PyObject *constraints, int covariant);
3601
3602 static PyObject *
3603 null_or_tuple_for_varargs(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
3604 {
3605 PyObject *return_value = NULL;
3606 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
3607
3608 #define NUM_KEYWORDS 2
3609 static struct {
3610 PyGC_Head _this_is_not_used;
3611 PyObject_VAR_HEAD
3612 Py_hash_t ob_hash;
3613 PyObject *ob_item[NUM_KEYWORDS];
3614 } _kwtuple = {
3615 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
3616 .ob_hash = -1,
3617 .ob_item = { &_Py_ID(name), &_Py_ID(covariant), },
3618 };
3619 #undef NUM_KEYWORDS
3620 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
3621
3622 #else // !Py_BUILD_CORE
3623 # define KWTUPLE NULL
3624 #endif // !Py_BUILD_CORE
3625
3626 static const char * const _keywords[] = {"name", "covariant", NULL};
3627 static _PyArg_Parser _parser = {
3628 .keywords = _keywords,
3629 .fname = "null_or_tuple_for_varargs",
3630 .kwtuple = KWTUPLE,
3631 };
3632 #undef KWTUPLE
3633 PyObject *argsbuf[2];
3634 PyObject * const *fastargs;
3635 Py_ssize_t noptargs = Py_MIN(nargs, 1) + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
3636 PyObject *name;
3637 PyObject *constraints = NULL;
3638 int covariant = 0;
3639
3640 fastargs = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
3641 /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 1, argsbuf);
3642 if (!fastargs) {
3643 goto exit;
3644 }
3645 name = fastargs[0];
3646 if (!noptargs) {
3647 goto skip_optional_kwonly;
3648 }
3649 covariant = PyObject_IsTrue(fastargs[1]);
3650 if (covariant < 0) {
3651 goto exit;
3652 }
3653 skip_optional_kwonly:
3654 constraints = nargs > 1
3655 ? _PyTuple_FromArray(args + 1, nargs - 1)
3656 : PyTuple_New(0);
3657 if (constraints == NULL) {
3658 goto exit;
3659 }
3660 return_value = null_or_tuple_for_varargs_impl(module, name, constraints, covariant);
3661
3662 exit:
3663 /* Cleanup for constraints */
3664 Py_XDECREF(constraints);
3665
3666 return return_value;
3667 }
3668
3669 PyDoc_STRVAR(clone_f1__doc__,
3670 "clone_f1($module, /, path)\n"
3671 "--\n"
3672 "\n");
3673
3674 #define CLONE_F1_METHODDEF \
3675 {"clone_f1", _PyCFunction_CAST(clone_f1), METH_FASTCALL|METH_KEYWORDS, clone_f1__doc__},
3676
3677 static PyObject *
3678 clone_f1_impl(PyObject *module, const char *path);
3679
3680 static PyObject *
3681 clone_f1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
3682 {
3683 PyObject *return_value = NULL;
3684 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
3685
3686 #define NUM_KEYWORDS 1
3687 static struct {
3688 PyGC_Head _this_is_not_used;
3689 PyObject_VAR_HEAD
3690 Py_hash_t ob_hash;
3691 PyObject *ob_item[NUM_KEYWORDS];
3692 } _kwtuple = {
3693 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
3694 .ob_hash = -1,
3695 .ob_item = { &_Py_ID(path), },
3696 };
3697 #undef NUM_KEYWORDS
3698 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
3699
3700 #else // !Py_BUILD_CORE
3701 # define KWTUPLE NULL
3702 #endif // !Py_BUILD_CORE
3703
3704 static const char * const _keywords[] = {"path", NULL};
3705 static _PyArg_Parser _parser = {
3706 .keywords = _keywords,
3707 .fname = "clone_f1",
3708 .kwtuple = KWTUPLE,
3709 };
3710 #undef KWTUPLE
3711 PyObject *argsbuf[1];
3712 const char *path;
3713
3714 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
3715 /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
3716 if (!args) {
3717 goto exit;
3718 }
3719 if (!PyUnicode_Check(args[0])) {
3720 _PyArg_BadArgument("clone_f1", "argument 'path'", "str", args[0]);
3721 goto exit;
3722 }
3723 Py_ssize_t path_length;
3724 path = PyUnicode_AsUTF8AndSize(args[0], &path_length);
3725 if (path == NULL) {
3726 goto exit;
3727 }
3728 if (strlen(path) != (size_t)path_length) {
3729 PyErr_SetString(PyExc_ValueError, "embedded null character");
3730 goto exit;
3731 }
3732 return_value = clone_f1_impl(module, path);
3733
3734 exit:
3735 return return_value;
3736 }
3737
3738 PyDoc_STRVAR(clone_f2__doc__,
3739 "clone_f2($module, /, path)\n"
3740 "--\n"
3741 "\n");
3742
3743 #define CLONE_F2_METHODDEF \
3744 {"clone_f2", _PyCFunction_CAST(clone_f2), METH_FASTCALL|METH_KEYWORDS, clone_f2__doc__},
3745
3746 static PyObject *
3747 clone_f2_impl(PyObject *module, const char *path);
3748
3749 static PyObject *
3750 clone_f2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
3751 {
3752 PyObject *return_value = NULL;
3753 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
3754
3755 #define NUM_KEYWORDS 1
3756 static struct {
3757 PyGC_Head _this_is_not_used;
3758 PyObject_VAR_HEAD
3759 Py_hash_t ob_hash;
3760 PyObject *ob_item[NUM_KEYWORDS];
3761 } _kwtuple = {
3762 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
3763 .ob_hash = -1,
3764 .ob_item = { &_Py_ID(path), },
3765 };
3766 #undef NUM_KEYWORDS
3767 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
3768
3769 #else // !Py_BUILD_CORE
3770 # define KWTUPLE NULL
3771 #endif // !Py_BUILD_CORE
3772
3773 static const char * const _keywords[] = {"path", NULL};
3774 static _PyArg_Parser _parser = {
3775 .keywords = _keywords,
3776 .fname = "clone_f2",
3777 .kwtuple = KWTUPLE,
3778 };
3779 #undef KWTUPLE
3780 PyObject *argsbuf[1];
3781 const char *path;
3782
3783 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
3784 /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
3785 if (!args) {
3786 goto exit;
3787 }
3788 if (!PyUnicode_Check(args[0])) {
3789 _PyArg_BadArgument("clone_f2", "argument 'path'", "str", args[0]);
3790 goto exit;
3791 }
3792 Py_ssize_t path_length;
3793 path = PyUnicode_AsUTF8AndSize(args[0], &path_length);
3794 if (path == NULL) {
3795 goto exit;
3796 }
3797 if (strlen(path) != (size_t)path_length) {
3798 PyErr_SetString(PyExc_ValueError, "embedded null character");
3799 goto exit;
3800 }
3801 return_value = clone_f2_impl(module, path);
3802
3803 exit:
3804 return return_value;
3805 }
3806
3807 PyDoc_STRVAR(clone_with_conv_f1__doc__,
3808 "clone_with_conv_f1($module, /, path=None)\n"
3809 "--\n"
3810 "\n");
3811
3812 #define CLONE_WITH_CONV_F1_METHODDEF \
3813 {"clone_with_conv_f1", _PyCFunction_CAST(clone_with_conv_f1), METH_FASTCALL|METH_KEYWORDS, clone_with_conv_f1__doc__},
3814
3815 static PyObject *
3816 clone_with_conv_f1_impl(PyObject *module, custom_t path);
3817
3818 static PyObject *
3819 clone_with_conv_f1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
3820 {
3821 PyObject *return_value = NULL;
3822 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
3823
3824 #define NUM_KEYWORDS 1
3825 static struct {
3826 PyGC_Head _this_is_not_used;
3827 PyObject_VAR_HEAD
3828 Py_hash_t ob_hash;
3829 PyObject *ob_item[NUM_KEYWORDS];
3830 } _kwtuple = {
3831 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
3832 .ob_hash = -1,
3833 .ob_item = { &_Py_ID(path), },
3834 };
3835 #undef NUM_KEYWORDS
3836 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
3837
3838 #else // !Py_BUILD_CORE
3839 # define KWTUPLE NULL
3840 #endif // !Py_BUILD_CORE
3841
3842 static const char * const _keywords[] = {"path", NULL};
3843 static _PyArg_Parser _parser = {
3844 .keywords = _keywords,
3845 .fname = "clone_with_conv_f1",
3846 .kwtuple = KWTUPLE,
3847 };
3848 #undef KWTUPLE
3849 PyObject *argsbuf[1];
3850 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
3851 custom_t path = {
3852 .name = "clone_with_conv_f1",
3853 };
3854
3855 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
3856 /*minpos*/ 0, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
3857 if (!args) {
3858 goto exit;
3859 }
3860 if (!noptargs) {
3861 goto skip_optional_pos;
3862 }
3863 if (!custom_converter(args[0], &path)) {
3864 goto exit;
3865 }
3866 skip_optional_pos:
3867 return_value = clone_with_conv_f1_impl(module, path);
3868
3869 exit:
3870 return return_value;
3871 }
3872
3873 PyDoc_STRVAR(clone_with_conv_f2__doc__,
3874 "clone_with_conv_f2($module, /, path=None)\n"
3875 "--\n"
3876 "\n");
3877
3878 #define CLONE_WITH_CONV_F2_METHODDEF \
3879 {"clone_with_conv_f2", _PyCFunction_CAST(clone_with_conv_f2), METH_FASTCALL|METH_KEYWORDS, clone_with_conv_f2__doc__},
3880
3881 static PyObject *
3882 clone_with_conv_f2_impl(PyObject *module, custom_t path);
3883
3884 static PyObject *
3885 clone_with_conv_f2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
3886 {
3887 PyObject *return_value = NULL;
3888 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
3889
3890 #define NUM_KEYWORDS 1
3891 static struct {
3892 PyGC_Head _this_is_not_used;
3893 PyObject_VAR_HEAD
3894 Py_hash_t ob_hash;
3895 PyObject *ob_item[NUM_KEYWORDS];
3896 } _kwtuple = {
3897 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
3898 .ob_hash = -1,
3899 .ob_item = { &_Py_ID(path), },
3900 };
3901 #undef NUM_KEYWORDS
3902 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
3903
3904 #else // !Py_BUILD_CORE
3905 # define KWTUPLE NULL
3906 #endif // !Py_BUILD_CORE
3907
3908 static const char * const _keywords[] = {"path", NULL};
3909 static _PyArg_Parser _parser = {
3910 .keywords = _keywords,
3911 .fname = "clone_with_conv_f2",
3912 .kwtuple = KWTUPLE,
3913 };
3914 #undef KWTUPLE
3915 PyObject *argsbuf[1];
3916 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
3917 custom_t path = {
3918 .name = "clone_with_conv_f2",
3919 };
3920
3921 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
3922 /*minpos*/ 0, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
3923 if (!args) {
3924 goto exit;
3925 }
3926 if (!noptargs) {
3927 goto skip_optional_pos;
3928 }
3929 if (!custom_converter(args[0], &path)) {
3930 goto exit;
3931 }
3932 skip_optional_pos:
3933 return_value = clone_with_conv_f2_impl(module, path);
3934
3935 exit:
3936 return return_value;
3937 }
3938
3939 PyDoc_STRVAR(_testclinic_TestClass_get_defining_class__doc__,
3940 "get_defining_class($self, /)\n"
3941 "--\n"
3942 "\n");
3943
3944 #define _TESTCLINIC_TESTCLASS_GET_DEFINING_CLASS_METHODDEF \
3945 {"get_defining_class", _PyCFunction_CAST(_testclinic_TestClass_get_defining_class), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _testclinic_TestClass_get_defining_class__doc__},
3946
3947 static PyObject *
3948 _testclinic_TestClass_get_defining_class_impl(PyObject *self,
3949 PyTypeObject *cls);
3950
3951 static PyObject *
3952 _testclinic_TestClass_get_defining_class(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
3953 {
3954 if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
3955 PyErr_SetString(PyExc_TypeError, "get_defining_class() takes no arguments");
3956 return NULL;
3957 }
3958 return _testclinic_TestClass_get_defining_class_impl(self, cls);
3959 }
3960
3961 PyDoc_STRVAR(_testclinic_TestClass_get_defining_class_arg__doc__,
3962 "get_defining_class_arg($self, /, arg)\n"
3963 "--\n"
3964 "\n");
3965
3966 #define _TESTCLINIC_TESTCLASS_GET_DEFINING_CLASS_ARG_METHODDEF \
3967 {"get_defining_class_arg", _PyCFunction_CAST(_testclinic_TestClass_get_defining_class_arg), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _testclinic_TestClass_get_defining_class_arg__doc__},
3968
3969 static PyObject *
3970 _testclinic_TestClass_get_defining_class_arg_impl(PyObject *self,
3971 PyTypeObject *cls,
3972 PyObject *arg);
3973
3974 static PyObject *
3975 _testclinic_TestClass_get_defining_class_arg(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
3976 {
3977 PyObject *return_value = NULL;
3978 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
3979
3980 #define NUM_KEYWORDS 1
3981 static struct {
3982 PyGC_Head _this_is_not_used;
3983 PyObject_VAR_HEAD
3984 Py_hash_t ob_hash;
3985 PyObject *ob_item[NUM_KEYWORDS];
3986 } _kwtuple = {
3987 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
3988 .ob_hash = -1,
3989 .ob_item = { &_Py_ID(arg), },
3990 };
3991 #undef NUM_KEYWORDS
3992 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
3993
3994 #else // !Py_BUILD_CORE
3995 # define KWTUPLE NULL
3996 #endif // !Py_BUILD_CORE
3997
3998 static const char * const _keywords[] = {"arg", NULL};
3999 static _PyArg_Parser _parser = {
4000 .keywords = _keywords,
4001 .fname = "get_defining_class_arg",
4002 .kwtuple = KWTUPLE,
4003 };
4004 #undef KWTUPLE
4005 PyObject *argsbuf[1];
4006 PyObject *arg;
4007
4008 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
4009 /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
4010 if (!args) {
4011 goto exit;
4012 }
4013 arg = args[0];
4014 return_value = _testclinic_TestClass_get_defining_class_arg_impl(self, cls, arg);
4015
4016 exit:
4017 return return_value;
4018 }
4019
4020 PyDoc_STRVAR(_testclinic_TestClass_defclass_varpos__doc__,
4021 "defclass_varpos($self, /, *args)\n"
4022 "--\n"
4023 "\n");
4024
4025 #define _TESTCLINIC_TESTCLASS_DEFCLASS_VARPOS_METHODDEF \
4026 {"defclass_varpos", _PyCFunction_CAST(_testclinic_TestClass_defclass_varpos), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _testclinic_TestClass_defclass_varpos__doc__},
4027
4028 static PyObject *
4029 _testclinic_TestClass_defclass_varpos_impl(PyObject *self, PyTypeObject *cls,
4030 PyObject *args);
4031
4032 static PyObject *
4033 _testclinic_TestClass_defclass_varpos(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
4034 {
4035 PyObject *return_value = NULL;
4036 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
4037 # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
4038 #else
4039 # define KWTUPLE NULL
4040 #endif
4041
4042 static const char * const _keywords[] = { NULL};
4043 static _PyArg_Parser _parser = {
4044 .keywords = _keywords,
4045 .fname = "defclass_varpos",
4046 .kwtuple = KWTUPLE,
4047 };
4048 #undef KWTUPLE
4049 PyObject *argsbuf[1];
4050 PyObject * const *fastargs;
4051 PyObject *__clinic_args = NULL;
4052
4053 fastargs = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
4054 /*minpos*/ 0, /*maxpos*/ 0, /*minkw*/ 0, /*varpos*/ 1, argsbuf);
4055 if (!fastargs) {
4056 goto exit;
4057 }
4058 __clinic_args = _PyTuple_FromArray(args, nargs);
4059 if (__clinic_args == NULL) {
4060 goto exit;
4061 }
4062 return_value = _testclinic_TestClass_defclass_varpos_impl(self, cls, __clinic_args);
4063
4064 exit:
4065 /* Cleanup for args */
4066 Py_XDECREF(__clinic_args);
4067
4068 return return_value;
4069 }
4070
4071 PyDoc_STRVAR(_testclinic_TestClass_defclass_posonly_varpos__doc__,
4072 "defclass_posonly_varpos($self, a, b, /, *args)\n"
4073 "--\n"
4074 "\n");
4075
4076 #define _TESTCLINIC_TESTCLASS_DEFCLASS_POSONLY_VARPOS_METHODDEF \
4077 {"defclass_posonly_varpos", _PyCFunction_CAST(_testclinic_TestClass_defclass_posonly_varpos), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _testclinic_TestClass_defclass_posonly_varpos__doc__},
4078
4079 static PyObject *
4080 _testclinic_TestClass_defclass_posonly_varpos_impl(PyObject *self,
4081 PyTypeObject *cls,
4082 PyObject *a, PyObject *b,
4083 PyObject *args);
4084
4085 static PyObject *
4086 _testclinic_TestClass_defclass_posonly_varpos(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
4087 {
4088 PyObject *return_value = NULL;
4089 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
4090 # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
4091 #else
4092 # define KWTUPLE NULL
4093 #endif
4094
4095 static const char * const _keywords[] = {"", "", NULL};
4096 static _PyArg_Parser _parser = {
4097 .keywords = _keywords,
4098 .fname = "defclass_posonly_varpos",
4099 .kwtuple = KWTUPLE,
4100 };
4101 #undef KWTUPLE
4102 PyObject *argsbuf[2];
4103 PyObject * const *fastargs;
4104 PyObject *a;
4105 PyObject *b;
4106 PyObject *__clinic_args = NULL;
4107
4108 fastargs = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
4109 /*minpos*/ 2, /*maxpos*/ 2, /*minkw*/ 0, /*varpos*/ 1, argsbuf);
4110 if (!fastargs) {
4111 goto exit;
4112 }
4113 a = fastargs[0];
4114 b = fastargs[1];
4115 __clinic_args = _PyTuple_FromArray(args + 2, nargs - 2);
4116 if (__clinic_args == NULL) {
4117 goto exit;
4118 }
4119 return_value = _testclinic_TestClass_defclass_posonly_varpos_impl(self, cls, a, b, __clinic_args);
4120
4121 exit:
4122 /* Cleanup for args */
4123 Py_XDECREF(__clinic_args);
4124
4125 return return_value;
4126 }
4127
4128 PyDoc_STRVAR(_testclinic_TestClass_varpos_no_fastcall__doc__,
4129 "varpos_no_fastcall($type, /, *args)\n"
4130 "--\n"
4131 "\n");
4132
4133 #define _TESTCLINIC_TESTCLASS_VARPOS_NO_FASTCALL_METHODDEF \
4134 {"varpos_no_fastcall", (PyCFunction)_testclinic_TestClass_varpos_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_varpos_no_fastcall__doc__},
4135
4136 static PyObject *
4137 _testclinic_TestClass_varpos_no_fastcall_impl(PyTypeObject *type,
4138 PyObject *args);
4139
4140 static PyObject *
4141 _testclinic_TestClass_varpos_no_fastcall(PyObject *type, PyObject *args)
4142 {
4143 PyObject *return_value = NULL;
4144 PyObject *__clinic_args = NULL;
4145
4146 __clinic_args = Py_NewRef(args);
4147 return_value = _testclinic_TestClass_varpos_no_fastcall_impl((PyTypeObject *)type, __clinic_args);
4148
4149 /* Cleanup for args */
4150 Py_XDECREF(__clinic_args);
4151
4152 return return_value;
4153 }
4154
4155 PyDoc_STRVAR(_testclinic_TestClass_posonly_varpos_no_fastcall__doc__,
4156 "posonly_varpos_no_fastcall($type, a, b, /, *args)\n"
4157 "--\n"
4158 "\n");
4159
4160 #define _TESTCLINIC_TESTCLASS_POSONLY_VARPOS_NO_FASTCALL_METHODDEF \
4161 {"posonly_varpos_no_fastcall", (PyCFunction)_testclinic_TestClass_posonly_varpos_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_posonly_varpos_no_fastcall__doc__},
4162
4163 static PyObject *
4164 _testclinic_TestClass_posonly_varpos_no_fastcall_impl(PyTypeObject *type,
4165 PyObject *a,
4166 PyObject *b,
4167 PyObject *args);
4168
4169 static PyObject *
4170 _testclinic_TestClass_posonly_varpos_no_fastcall(PyObject *type, PyObject *args)
4171 {
4172 PyObject *return_value = NULL;
4173 PyObject *a;
4174 PyObject *b;
4175 PyObject *__clinic_args = NULL;
4176
4177 if (!_PyArg_CheckPositional("posonly_varpos_no_fastcall", PyTuple_GET_SIZE(args), 2, PY_SSIZE_T_MAX)) {
4178 goto exit;
4179 }
4180 a = PyTuple_GET_ITEM(args, 0);
4181 b = PyTuple_GET_ITEM(args, 1);
4182 __clinic_args = PyTuple_GetSlice(args, 2, PY_SSIZE_T_MAX);
4183 if (!__clinic_args) {
4184 goto exit;
4185 }
4186 return_value = _testclinic_TestClass_posonly_varpos_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args);
4187
4188 exit:
4189 /* Cleanup for args */
4190 Py_XDECREF(__clinic_args);
4191
4192 return return_value;
4193 }
4194
4195 PyDoc_STRVAR(_testclinic_TestClass_posonly_req_opt_varpos_no_fastcall__doc__,
4196 "posonly_req_opt_varpos_no_fastcall($type, a, b=False, /, *args)\n"
4197 "--\n"
4198 "\n");
4199
4200 #define _TESTCLINIC_TESTCLASS_POSONLY_REQ_OPT_VARPOS_NO_FASTCALL_METHODDEF \
4201 {"posonly_req_opt_varpos_no_fastcall", (PyCFunction)_testclinic_TestClass_posonly_req_opt_varpos_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_posonly_req_opt_varpos_no_fastcall__doc__},
4202
4203 static PyObject *
4204 _testclinic_TestClass_posonly_req_opt_varpos_no_fastcall_impl(PyTypeObject *type,
4205 PyObject *a,
4206 PyObject *b,
4207 PyObject *args);
4208
4209 static PyObject *
4210 _testclinic_TestClass_posonly_req_opt_varpos_no_fastcall(PyObject *type, PyObject *args)
4211 {
4212 PyObject *return_value = NULL;
4213 PyObject *a;
4214 PyObject *b = Py_False;
4215 PyObject *__clinic_args = NULL;
4216
4217 if (!_PyArg_CheckPositional("posonly_req_opt_varpos_no_fastcall", PyTuple_GET_SIZE(args), 1, PY_SSIZE_T_MAX)) {
4218 goto exit;
4219 }
4220 a = PyTuple_GET_ITEM(args, 0);
4221 if (PyTuple_GET_SIZE(args) < 2) {
4222 goto skip_optional;
4223 }
4224 b = PyTuple_GET_ITEM(args, 1);
4225 skip_optional:
4226 __clinic_args = PyTuple_GetSlice(args, 2, PY_SSIZE_T_MAX);
4227 if (!__clinic_args) {
4228 goto exit;
4229 }
4230 return_value = _testclinic_TestClass_posonly_req_opt_varpos_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args);
4231
4232 exit:
4233 /* Cleanup for args */
4234 Py_XDECREF(__clinic_args);
4235
4236 return return_value;
4237 }
4238
4239 PyDoc_STRVAR(_testclinic_TestClass_posonly_poskw_varpos_no_fastcall__doc__,
4240 "posonly_poskw_varpos_no_fastcall($type, a, /, b, *args)\n"
4241 "--\n"
4242 "\n");
4243
4244 #define _TESTCLINIC_TESTCLASS_POSONLY_POSKW_VARPOS_NO_FASTCALL_METHODDEF \
4245 {"posonly_poskw_varpos_no_fastcall", _PyCFunction_CAST(_testclinic_TestClass_posonly_poskw_varpos_no_fastcall), METH_VARARGS|METH_KEYWORDS|METH_CLASS, _testclinic_TestClass_posonly_poskw_varpos_no_fastcall__doc__},
4246
4247 static PyObject *
4248 _testclinic_TestClass_posonly_poskw_varpos_no_fastcall_impl(PyTypeObject *type,
4249 PyObject *a,
4250 PyObject *b,
4251 PyObject *args);
4252
4253 static PyObject *
4254 _testclinic_TestClass_posonly_poskw_varpos_no_fastcall(PyObject *type, PyObject *args, PyObject *kwargs)
4255 {
4256 PyObject *return_value = NULL;
4257 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
4258
4259 #define NUM_KEYWORDS 1
4260 static struct {
4261 PyGC_Head _this_is_not_used;
4262 PyObject_VAR_HEAD
4263 Py_hash_t ob_hash;
4264 PyObject *ob_item[NUM_KEYWORDS];
4265 } _kwtuple = {
4266 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
4267 .ob_hash = -1,
4268 .ob_item = { _Py_LATIN1_CHR('b'), },
4269 };
4270 #undef NUM_KEYWORDS
4271 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
4272
4273 #else // !Py_BUILD_CORE
4274 # define KWTUPLE NULL
4275 #endif // !Py_BUILD_CORE
4276
4277 static const char * const _keywords[] = {"", "b", NULL};
4278 static _PyArg_Parser _parser = {
4279 .keywords = _keywords,
4280 .fname = "posonly_poskw_varpos_no_fastcall",
4281 .kwtuple = KWTUPLE,
4282 };
4283 #undef KWTUPLE
4284 PyObject *argsbuf[2];
4285 PyObject * const *fastargs;
4286 Py_ssize_t nargs = PyTuple_GET_SIZE(args);
4287 PyObject *a;
4288 PyObject *b;
4289 PyObject *__clinic_args = NULL;
4290
4291 fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser,
4292 /*minpos*/ 2, /*maxpos*/ 2, /*minkw*/ 0, /*varpos*/ 1, argsbuf);
4293 if (!fastargs) {
4294 goto exit;
4295 }
4296 a = fastargs[0];
4297 b = fastargs[1];
4298 __clinic_args = PyTuple_GetSlice(args, 2, PY_SSIZE_T_MAX);
4299 if (!__clinic_args) {
4300 goto exit;
4301 }
4302 return_value = _testclinic_TestClass_posonly_poskw_varpos_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args);
4303
4304 exit:
4305 /* Cleanup for args */
4306 Py_XDECREF(__clinic_args);
4307
4308 return return_value;
4309 }
4310
4311 PyDoc_STRVAR(_testclinic_TestClass_varpos_array_no_fastcall__doc__,
4312 "varpos_array_no_fastcall($type, /, *args)\n"
4313 "--\n"
4314 "\n");
4315
4316 #define _TESTCLINIC_TESTCLASS_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \
4317 {"varpos_array_no_fastcall", (PyCFunction)_testclinic_TestClass_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_varpos_array_no_fastcall__doc__},
4318
4319 static PyObject *
4320 _testclinic_TestClass_varpos_array_no_fastcall_impl(PyTypeObject *type,
4321 PyObject * const *args,
4322 Py_ssize_t args_length);
4323
4324 static PyObject *
4325 _testclinic_TestClass_varpos_array_no_fastcall(PyObject *type, PyObject *args)
4326 {
4327 PyObject *return_value = NULL;
4328 PyObject * const *__clinic_args;
4329 Py_ssize_t args_length;
4330
4331 __clinic_args = _PyTuple_ITEMS(args);
4332 args_length = PyTuple_GET_SIZE(args);
4333 return_value = _testclinic_TestClass_varpos_array_no_fastcall_impl((PyTypeObject *)type, __clinic_args, args_length);
4334
4335 return return_value;
4336 }
4337
4338 PyDoc_STRVAR(_testclinic_TestClass_posonly_varpos_array_no_fastcall__doc__,
4339 "posonly_varpos_array_no_fastcall($type, a, b, /, *args)\n"
4340 "--\n"
4341 "\n");
4342
4343 #define _TESTCLINIC_TESTCLASS_POSONLY_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \
4344 {"posonly_varpos_array_no_fastcall", (PyCFunction)_testclinic_TestClass_posonly_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_posonly_varpos_array_no_fastcall__doc__},
4345
4346 static PyObject *
4347 _testclinic_TestClass_posonly_varpos_array_no_fastcall_impl(PyTypeObject *type,
4348 PyObject *a,
4349 PyObject *b,
4350 PyObject * const *args,
4351 Py_ssize_t args_length);
4352
4353 static PyObject *
4354 _testclinic_TestClass_posonly_varpos_array_no_fastcall(PyObject *type, PyObject *args)
4355 {
4356 PyObject *return_value = NULL;
4357 PyObject *a;
4358 PyObject *b;
4359 PyObject * const *__clinic_args;
4360 Py_ssize_t args_length;
4361
4362 if (!_PyArg_CheckPositional("posonly_varpos_array_no_fastcall", PyTuple_GET_SIZE(args), 2, PY_SSIZE_T_MAX)) {
4363 goto exit;
4364 }
4365 a = PyTuple_GET_ITEM(args, 0);
4366 b = PyTuple_GET_ITEM(args, 1);
4367 __clinic_args = _PyTuple_ITEMS(args) + 2;
4368 args_length = PyTuple_GET_SIZE(args) - 2;
4369 return_value = _testclinic_TestClass_posonly_varpos_array_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args, args_length);
4370
4371 exit:
4372 return return_value;
4373 }
4374
4375 PyDoc_STRVAR(_testclinic_TestClass_posonly_req_opt_varpos_array_no_fastcall__doc__,
4376 "posonly_req_opt_varpos_array_no_fastcall($type, a, b=False, /, *args)\n"
4377 "--\n"
4378 "\n");
4379
4380 #define _TESTCLINIC_TESTCLASS_POSONLY_REQ_OPT_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \
4381 {"posonly_req_opt_varpos_array_no_fastcall", (PyCFunction)_testclinic_TestClass_posonly_req_opt_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_posonly_req_opt_varpos_array_no_fastcall__doc__},
4382
4383 static PyObject *
4384 _testclinic_TestClass_posonly_req_opt_varpos_array_no_fastcall_impl(PyTypeObject *type,
4385 PyObject *a,
4386 PyObject *b,
4387 PyObject * const *args,
4388 Py_ssize_t args_length);
4389
4390 static PyObject *
4391 _testclinic_TestClass_posonly_req_opt_varpos_array_no_fastcall(PyObject *type, PyObject *args)
4392 {
4393 PyObject *return_value = NULL;
4394 PyObject *a;
4395 PyObject *b = Py_False;
4396 PyObject * const *__clinic_args;
4397 Py_ssize_t args_length;
4398
4399 if (!_PyArg_CheckPositional("posonly_req_opt_varpos_array_no_fastcall", PyTuple_GET_SIZE(args), 1, PY_SSIZE_T_MAX)) {
4400 goto exit;
4401 }
4402 a = PyTuple_GET_ITEM(args, 0);
4403 if (PyTuple_GET_SIZE(args) < 2) {
4404 goto skip_optional;
4405 }
4406 b = PyTuple_GET_ITEM(args, 1);
4407 skip_optional:
4408 __clinic_args = PyTuple_GET_SIZE(args) > 2 ? _PyTuple_ITEMS(args) + 2 : _PyTuple_ITEMS(args);
4409 args_length = Py_MAX(0, PyTuple_GET_SIZE(args) - 2);
4410 return_value = _testclinic_TestClass_posonly_req_opt_varpos_array_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args, args_length);
4411
4412 exit:
4413 return return_value;
4414 }
4415
4416 PyDoc_STRVAR(_testclinic_TestClass_posonly_poskw_varpos_array_no_fastcall__doc__,
4417 "posonly_poskw_varpos_array_no_fastcall($type, a, /, b, *args)\n"
4418 "--\n"
4419 "\n");
4420
4421 #define _TESTCLINIC_TESTCLASS_POSONLY_POSKW_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \
4422 {"posonly_poskw_varpos_array_no_fastcall", _PyCFunction_CAST(_testclinic_TestClass_posonly_poskw_varpos_array_no_fastcall), METH_VARARGS|METH_KEYWORDS|METH_CLASS, _testclinic_TestClass_posonly_poskw_varpos_array_no_fastcall__doc__},
4423
4424 static PyObject *
4425 _testclinic_TestClass_posonly_poskw_varpos_array_no_fastcall_impl(PyTypeObject *type,
4426 PyObject *a,
4427 PyObject *b,
4428 PyObject * const *args,
4429 Py_ssize_t args_length);
4430
4431 static PyObject *
4432 _testclinic_TestClass_posonly_poskw_varpos_array_no_fastcall(PyObject *type, PyObject *args, PyObject *kwargs)
4433 {
4434 PyObject *return_value = NULL;
4435 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
4436
4437 #define NUM_KEYWORDS 1
4438 static struct {
4439 PyGC_Head _this_is_not_used;
4440 PyObject_VAR_HEAD
4441 Py_hash_t ob_hash;
4442 PyObject *ob_item[NUM_KEYWORDS];
4443 } _kwtuple = {
4444 .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
4445 .ob_hash = -1,
4446 .ob_item = { _Py_LATIN1_CHR('b'), },
4447 };
4448 #undef NUM_KEYWORDS
4449 #define KWTUPLE (&_kwtuple.ob_base.ob_base)
4450
4451 #else // !Py_BUILD_CORE
4452 # define KWTUPLE NULL
4453 #endif // !Py_BUILD_CORE
4454
4455 static const char * const _keywords[] = {"", "b", NULL};
4456 static _PyArg_Parser _parser = {
4457 .keywords = _keywords,
4458 .fname = "posonly_poskw_varpos_array_no_fastcall",
4459 .kwtuple = KWTUPLE,
4460 };
4461 #undef KWTUPLE
4462 PyObject *argsbuf[2];
4463 PyObject * const *fastargs;
4464 Py_ssize_t nargs = PyTuple_GET_SIZE(args);
4465 PyObject *a;
4466 PyObject *b;
4467 PyObject * const *__clinic_args;
4468 Py_ssize_t args_length;
4469
4470 fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser,
4471 /*minpos*/ 2, /*maxpos*/ 2, /*minkw*/ 0, /*varpos*/ 1, argsbuf);
4472 if (!fastargs) {
4473 goto exit;
4474 }
4475 a = fastargs[0];
4476 b = fastargs[1];
4477 __clinic_args = PyTuple_GET_SIZE(args) > 2 ? _PyTuple_ITEMS(args) + 2 : _PyTuple_ITEMS(args);
4478 args_length = Py_MAX(0, PyTuple_GET_SIZE(args) - 2);
4479 return_value = _testclinic_TestClass_posonly_poskw_varpos_array_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args, args_length);
4480
4481 exit:
4482 return return_value;
4483 }
4484 /*[clinic end generated code: output=8af194d826d6740d input=a9049054013a1b77]*/