1/*[clinic input]
2preserve
3[clinic start generated code]*/
4
5PyDoc_STRVAR(_operator_truth__doc__,
6"truth($module, a, /)\n"
7"--\n"
8"\n"
9"Return True if a is true, False otherwise.");
10
11#define _OPERATOR_TRUTH_METHODDEF \
12 {"truth", (PyCFunction)_operator_truth, METH_O, _operator_truth__doc__},
13
14static int
15_operator_truth_impl(PyObject *module, PyObject *a);
16
17static PyObject *
18_operator_truth(PyObject *module, PyObject *a)
19{
20 PyObject *return_value = NULL;
21 int _return_value;
22
23 _return_value = _operator_truth_impl(module, a);
24 if ((_return_value == -1) && PyErr_Occurred()) {
25 goto exit;
26 }
27 return_value = PyBool_FromLong((long)_return_value);
28
29exit:
30 return return_value;
31}
32
33PyDoc_STRVAR(_operator_add__doc__,
34"add($module, a, b, /)\n"
35"--\n"
36"\n"
37"Same as a + b.");
38
39#define _OPERATOR_ADD_METHODDEF \
40 {"add", (PyCFunction)(void(*)(void))_operator_add, METH_FASTCALL, _operator_add__doc__},
41
42static PyObject *
43_operator_add_impl(PyObject *module, PyObject *a, PyObject *b);
44
45static PyObject *
46_operator_add(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
47{
48 PyObject *return_value = NULL;
49 PyObject *a;
50 PyObject *b;
51
52 if (!_PyArg_CheckPositional("add", nargs, 2, 2)) {
53 goto exit;
54 }
55 a = args[0];
56 b = args[1];
57 return_value = _operator_add_impl(module, a, b);
58
59exit:
60 return return_value;
61}
62
63PyDoc_STRVAR(_operator_sub__doc__,
64"sub($module, a, b, /)\n"
65"--\n"
66"\n"
67"Same as a - b.");
68
69#define _OPERATOR_SUB_METHODDEF \
70 {"sub", (PyCFunction)(void(*)(void))_operator_sub, METH_FASTCALL, _operator_sub__doc__},
71
72static PyObject *
73_operator_sub_impl(PyObject *module, PyObject *a, PyObject *b);
74
75static PyObject *
76_operator_sub(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
77{
78 PyObject *return_value = NULL;
79 PyObject *a;
80 PyObject *b;
81
82 if (!_PyArg_CheckPositional("sub", nargs, 2, 2)) {
83 goto exit;
84 }
85 a = args[0];
86 b = args[1];
87 return_value = _operator_sub_impl(module, a, b);
88
89exit:
90 return return_value;
91}
92
93PyDoc_STRVAR(_operator_mul__doc__,
94"mul($module, a, b, /)\n"
95"--\n"
96"\n"
97"Same as a * b.");
98
99#define _OPERATOR_MUL_METHODDEF \
100 {"mul", (PyCFunction)(void(*)(void))_operator_mul, METH_FASTCALL, _operator_mul__doc__},
101
102static PyObject *
103_operator_mul_impl(PyObject *module, PyObject *a, PyObject *b);
104
105static PyObject *
106_operator_mul(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
107{
108 PyObject *return_value = NULL;
109 PyObject *a;
110 PyObject *b;
111
112 if (!_PyArg_CheckPositional("mul", nargs, 2, 2)) {
113 goto exit;
114 }
115 a = args[0];
116 b = args[1];
117 return_value = _operator_mul_impl(module, a, b);
118
119exit:
120 return return_value;
121}
122
123PyDoc_STRVAR(_operator_matmul__doc__,
124"matmul($module, a, b, /)\n"
125"--\n"
126"\n"
127"Same as a @ b.");
128
129#define _OPERATOR_MATMUL_METHODDEF \
130 {"matmul", (PyCFunction)(void(*)(void))_operator_matmul, METH_FASTCALL, _operator_matmul__doc__},
131
132static PyObject *
133_operator_matmul_impl(PyObject *module, PyObject *a, PyObject *b);
134
135static PyObject *
136_operator_matmul(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
137{
138 PyObject *return_value = NULL;
139 PyObject *a;
140 PyObject *b;
141
142 if (!_PyArg_CheckPositional("matmul", nargs, 2, 2)) {
143 goto exit;
144 }
145 a = args[0];
146 b = args[1];
147 return_value = _operator_matmul_impl(module, a, b);
148
149exit:
150 return return_value;
151}
152
153PyDoc_STRVAR(_operator_floordiv__doc__,
154"floordiv($module, a, b, /)\n"
155"--\n"
156"\n"
157"Same as a // b.");
158
159#define _OPERATOR_FLOORDIV_METHODDEF \
160 {"floordiv", (PyCFunction)(void(*)(void))_operator_floordiv, METH_FASTCALL, _operator_floordiv__doc__},
161
162static PyObject *
163_operator_floordiv_impl(PyObject *module, PyObject *a, PyObject *b);
164
165static PyObject *
166_operator_floordiv(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
167{
168 PyObject *return_value = NULL;
169 PyObject *a;
170 PyObject *b;
171
172 if (!_PyArg_CheckPositional("floordiv", nargs, 2, 2)) {
173 goto exit;
174 }
175 a = args[0];
176 b = args[1];
177 return_value = _operator_floordiv_impl(module, a, b);
178
179exit:
180 return return_value;
181}
182
183PyDoc_STRVAR(_operator_truediv__doc__,
184"truediv($module, a, b, /)\n"
185"--\n"
186"\n"
187"Same as a / b.");
188
189#define _OPERATOR_TRUEDIV_METHODDEF \
190 {"truediv", (PyCFunction)(void(*)(void))_operator_truediv, METH_FASTCALL, _operator_truediv__doc__},
191
192static PyObject *
193_operator_truediv_impl(PyObject *module, PyObject *a, PyObject *b);
194
195static PyObject *
196_operator_truediv(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
197{
198 PyObject *return_value = NULL;
199 PyObject *a;
200 PyObject *b;
201
202 if (!_PyArg_CheckPositional("truediv", nargs, 2, 2)) {
203 goto exit;
204 }
205 a = args[0];
206 b = args[1];
207 return_value = _operator_truediv_impl(module, a, b);
208
209exit:
210 return return_value;
211}
212
213PyDoc_STRVAR(_operator_mod__doc__,
214"mod($module, a, b, /)\n"
215"--\n"
216"\n"
217"Same as a % b.");
218
219#define _OPERATOR_MOD_METHODDEF \
220 {"mod", (PyCFunction)(void(*)(void))_operator_mod, METH_FASTCALL, _operator_mod__doc__},
221
222static PyObject *
223_operator_mod_impl(PyObject *module, PyObject *a, PyObject *b);
224
225static PyObject *
226_operator_mod(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
227{
228 PyObject *return_value = NULL;
229 PyObject *a;
230 PyObject *b;
231
232 if (!_PyArg_CheckPositional("mod", nargs, 2, 2)) {
233 goto exit;
234 }
235 a = args[0];
236 b = args[1];
237 return_value = _operator_mod_impl(module, a, b);
238
239exit:
240 return return_value;
241}
242
243PyDoc_STRVAR(_operator_neg__doc__,
244"neg($module, a, /)\n"
245"--\n"
246"\n"
247"Same as -a.");
248
249#define _OPERATOR_NEG_METHODDEF \
250 {"neg", (PyCFunction)_operator_neg, METH_O, _operator_neg__doc__},
251
252PyDoc_STRVAR(_operator_pos__doc__,
253"pos($module, a, /)\n"
254"--\n"
255"\n"
256"Same as +a.");
257
258#define _OPERATOR_POS_METHODDEF \
259 {"pos", (PyCFunction)_operator_pos, METH_O, _operator_pos__doc__},
260
261PyDoc_STRVAR(_operator_abs__doc__,
262"abs($module, a, /)\n"
263"--\n"
264"\n"
265"Same as abs(a).");
266
267#define _OPERATOR_ABS_METHODDEF \
268 {"abs", (PyCFunction)_operator_abs, METH_O, _operator_abs__doc__},
269
270PyDoc_STRVAR(_operator_inv__doc__,
271"inv($module, a, /)\n"
272"--\n"
273"\n"
274"Same as ~a.");
275
276#define _OPERATOR_INV_METHODDEF \
277 {"inv", (PyCFunction)_operator_inv, METH_O, _operator_inv__doc__},
278
279PyDoc_STRVAR(_operator_invert__doc__,
280"invert($module, a, /)\n"
281"--\n"
282"\n"
283"Same as ~a.");
284
285#define _OPERATOR_INVERT_METHODDEF \
286 {"invert", (PyCFunction)_operator_invert, METH_O, _operator_invert__doc__},
287
288PyDoc_STRVAR(_operator_lshift__doc__,
289"lshift($module, a, b, /)\n"
290"--\n"
291"\n"
292"Same as a << b.");
293
294#define _OPERATOR_LSHIFT_METHODDEF \
295 {"lshift", (PyCFunction)(void(*)(void))_operator_lshift, METH_FASTCALL, _operator_lshift__doc__},
296
297static PyObject *
298_operator_lshift_impl(PyObject *module, PyObject *a, PyObject *b);
299
300static PyObject *
301_operator_lshift(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
302{
303 PyObject *return_value = NULL;
304 PyObject *a;
305 PyObject *b;
306
307 if (!_PyArg_CheckPositional("lshift", nargs, 2, 2)) {
308 goto exit;
309 }
310 a = args[0];
311 b = args[1];
312 return_value = _operator_lshift_impl(module, a, b);
313
314exit:
315 return return_value;
316}
317
318PyDoc_STRVAR(_operator_rshift__doc__,
319"rshift($module, a, b, /)\n"
320"--\n"
321"\n"
322"Same as a >> b.");
323
324#define _OPERATOR_RSHIFT_METHODDEF \
325 {"rshift", (PyCFunction)(void(*)(void))_operator_rshift, METH_FASTCALL, _operator_rshift__doc__},
326
327static PyObject *
328_operator_rshift_impl(PyObject *module, PyObject *a, PyObject *b);
329
330static PyObject *
331_operator_rshift(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
332{
333 PyObject *return_value = NULL;
334 PyObject *a;
335 PyObject *b;
336
337 if (!_PyArg_CheckPositional("rshift", nargs, 2, 2)) {
338 goto exit;
339 }
340 a = args[0];
341 b = args[1];
342 return_value = _operator_rshift_impl(module, a, b);
343
344exit:
345 return return_value;
346}
347
348PyDoc_STRVAR(_operator_not___doc__,
349"not_($module, a, /)\n"
350"--\n"
351"\n"
352"Same as not a.");
353
354#define _OPERATOR_NOT__METHODDEF \
355 {"not_", (PyCFunction)_operator_not_, METH_O, _operator_not___doc__},
356
357static int
358_operator_not__impl(PyObject *module, PyObject *a);
359
360static PyObject *
361_operator_not_(PyObject *module, PyObject *a)
362{
363 PyObject *return_value = NULL;
364 int _return_value;
365
366 _return_value = _operator_not__impl(module, a);
367 if ((_return_value == -1) && PyErr_Occurred()) {
368 goto exit;
369 }
370 return_value = PyBool_FromLong((long)_return_value);
371
372exit:
373 return return_value;
374}
375
376PyDoc_STRVAR(_operator_and___doc__,
377"and_($module, a, b, /)\n"
378"--\n"
379"\n"
380"Same as a & b.");
381
382#define _OPERATOR_AND__METHODDEF \
383 {"and_", (PyCFunction)(void(*)(void))_operator_and_, METH_FASTCALL, _operator_and___doc__},
384
385static PyObject *
386_operator_and__impl(PyObject *module, PyObject *a, PyObject *b);
387
388static PyObject *
389_operator_and_(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
390{
391 PyObject *return_value = NULL;
392 PyObject *a;
393 PyObject *b;
394
395 if (!_PyArg_CheckPositional("and_", nargs, 2, 2)) {
396 goto exit;
397 }
398 a = args[0];
399 b = args[1];
400 return_value = _operator_and__impl(module, a, b);
401
402exit:
403 return return_value;
404}
405
406PyDoc_STRVAR(_operator_xor__doc__,
407"xor($module, a, b, /)\n"
408"--\n"
409"\n"
410"Same as a ^ b.");
411
412#define _OPERATOR_XOR_METHODDEF \
413 {"xor", (PyCFunction)(void(*)(void))_operator_xor, METH_FASTCALL, _operator_xor__doc__},
414
415static PyObject *
416_operator_xor_impl(PyObject *module, PyObject *a, PyObject *b);
417
418static PyObject *
419_operator_xor(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
420{
421 PyObject *return_value = NULL;
422 PyObject *a;
423 PyObject *b;
424
425 if (!_PyArg_CheckPositional("xor", nargs, 2, 2)) {
426 goto exit;
427 }
428 a = args[0];
429 b = args[1];
430 return_value = _operator_xor_impl(module, a, b);
431
432exit:
433 return return_value;
434}
435
436PyDoc_STRVAR(_operator_or___doc__,
437"or_($module, a, b, /)\n"
438"--\n"
439"\n"
440"Same as a | b.");
441
442#define _OPERATOR_OR__METHODDEF \
443 {"or_", (PyCFunction)(void(*)(void))_operator_or_, METH_FASTCALL, _operator_or___doc__},
444
445static PyObject *
446_operator_or__impl(PyObject *module, PyObject *a, PyObject *b);
447
448static PyObject *
449_operator_or_(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
450{
451 PyObject *return_value = NULL;
452 PyObject *a;
453 PyObject *b;
454
455 if (!_PyArg_CheckPositional("or_", nargs, 2, 2)) {
456 goto exit;
457 }
458 a = args[0];
459 b = args[1];
460 return_value = _operator_or__impl(module, a, b);
461
462exit:
463 return return_value;
464}
465
466PyDoc_STRVAR(_operator_iadd__doc__,
467"iadd($module, a, b, /)\n"
468"--\n"
469"\n"
470"Same as a += b.");
471
472#define _OPERATOR_IADD_METHODDEF \
473 {"iadd", (PyCFunction)(void(*)(void))_operator_iadd, METH_FASTCALL, _operator_iadd__doc__},
474
475static PyObject *
476_operator_iadd_impl(PyObject *module, PyObject *a, PyObject *b);
477
478static PyObject *
479_operator_iadd(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
480{
481 PyObject *return_value = NULL;
482 PyObject *a;
483 PyObject *b;
484
485 if (!_PyArg_CheckPositional("iadd", nargs, 2, 2)) {
486 goto exit;
487 }
488 a = args[0];
489 b = args[1];
490 return_value = _operator_iadd_impl(module, a, b);
491
492exit:
493 return return_value;
494}
495
496PyDoc_STRVAR(_operator_isub__doc__,
497"isub($module, a, b, /)\n"
498"--\n"
499"\n"
500"Same as a -= b.");
501
502#define _OPERATOR_ISUB_METHODDEF \
503 {"isub", (PyCFunction)(void(*)(void))_operator_isub, METH_FASTCALL, _operator_isub__doc__},
504
505static PyObject *
506_operator_isub_impl(PyObject *module, PyObject *a, PyObject *b);
507
508static PyObject *
509_operator_isub(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
510{
511 PyObject *return_value = NULL;
512 PyObject *a;
513 PyObject *b;
514
515 if (!_PyArg_CheckPositional("isub", nargs, 2, 2)) {
516 goto exit;
517 }
518 a = args[0];
519 b = args[1];
520 return_value = _operator_isub_impl(module, a, b);
521
522exit:
523 return return_value;
524}
525
526PyDoc_STRVAR(_operator_imul__doc__,
527"imul($module, a, b, /)\n"
528"--\n"
529"\n"
530"Same as a *= b.");
531
532#define _OPERATOR_IMUL_METHODDEF \
533 {"imul", (PyCFunction)(void(*)(void))_operator_imul, METH_FASTCALL, _operator_imul__doc__},
534
535static PyObject *
536_operator_imul_impl(PyObject *module, PyObject *a, PyObject *b);
537
538static PyObject *
539_operator_imul(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
540{
541 PyObject *return_value = NULL;
542 PyObject *a;
543 PyObject *b;
544
545 if (!_PyArg_CheckPositional("imul", nargs, 2, 2)) {
546 goto exit;
547 }
548 a = args[0];
549 b = args[1];
550 return_value = _operator_imul_impl(module, a, b);
551
552exit:
553 return return_value;
554}
555
556PyDoc_STRVAR(_operator_imatmul__doc__,
557"imatmul($module, a, b, /)\n"
558"--\n"
559"\n"
560"Same as a @= b.");
561
562#define _OPERATOR_IMATMUL_METHODDEF \
563 {"imatmul", (PyCFunction)(void(*)(void))_operator_imatmul, METH_FASTCALL, _operator_imatmul__doc__},
564
565static PyObject *
566_operator_imatmul_impl(PyObject *module, PyObject *a, PyObject *b);
567
568static PyObject *
569_operator_imatmul(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
570{
571 PyObject *return_value = NULL;
572 PyObject *a;
573 PyObject *b;
574
575 if (!_PyArg_CheckPositional("imatmul", nargs, 2, 2)) {
576 goto exit;
577 }
578 a = args[0];
579 b = args[1];
580 return_value = _operator_imatmul_impl(module, a, b);
581
582exit:
583 return return_value;
584}
585
586PyDoc_STRVAR(_operator_ifloordiv__doc__,
587"ifloordiv($module, a, b, /)\n"
588"--\n"
589"\n"
590"Same as a //= b.");
591
592#define _OPERATOR_IFLOORDIV_METHODDEF \
593 {"ifloordiv", (PyCFunction)(void(*)(void))_operator_ifloordiv, METH_FASTCALL, _operator_ifloordiv__doc__},
594
595static PyObject *
596_operator_ifloordiv_impl(PyObject *module, PyObject *a, PyObject *b);
597
598static PyObject *
599_operator_ifloordiv(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
600{
601 PyObject *return_value = NULL;
602 PyObject *a;
603 PyObject *b;
604
605 if (!_PyArg_CheckPositional("ifloordiv", nargs, 2, 2)) {
606 goto exit;
607 }
608 a = args[0];
609 b = args[1];
610 return_value = _operator_ifloordiv_impl(module, a, b);
611
612exit:
613 return return_value;
614}
615
616PyDoc_STRVAR(_operator_itruediv__doc__,
617"itruediv($module, a, b, /)\n"
618"--\n"
619"\n"
620"Same as a /= b.");
621
622#define _OPERATOR_ITRUEDIV_METHODDEF \
623 {"itruediv", (PyCFunction)(void(*)(void))_operator_itruediv, METH_FASTCALL, _operator_itruediv__doc__},
624
625static PyObject *
626_operator_itruediv_impl(PyObject *module, PyObject *a, PyObject *b);
627
628static PyObject *
629_operator_itruediv(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
630{
631 PyObject *return_value = NULL;
632 PyObject *a;
633 PyObject *b;
634
635 if (!_PyArg_CheckPositional("itruediv", nargs, 2, 2)) {
636 goto exit;
637 }
638 a = args[0];
639 b = args[1];
640 return_value = _operator_itruediv_impl(module, a, b);
641
642exit:
643 return return_value;
644}
645
646PyDoc_STRVAR(_operator_imod__doc__,
647"imod($module, a, b, /)\n"
648"--\n"
649"\n"
650"Same as a %= b.");
651
652#define _OPERATOR_IMOD_METHODDEF \
653 {"imod", (PyCFunction)(void(*)(void))_operator_imod, METH_FASTCALL, _operator_imod__doc__},
654
655static PyObject *
656_operator_imod_impl(PyObject *module, PyObject *a, PyObject *b);
657
658static PyObject *
659_operator_imod(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
660{
661 PyObject *return_value = NULL;
662 PyObject *a;
663 PyObject *b;
664
665 if (!_PyArg_CheckPositional("imod", nargs, 2, 2)) {
666 goto exit;
667 }
668 a = args[0];
669 b = args[1];
670 return_value = _operator_imod_impl(module, a, b);
671
672exit:
673 return return_value;
674}
675
676PyDoc_STRVAR(_operator_ilshift__doc__,
677"ilshift($module, a, b, /)\n"
678"--\n"
679"\n"
680"Same as a <<= b.");
681
682#define _OPERATOR_ILSHIFT_METHODDEF \
683 {"ilshift", (PyCFunction)(void(*)(void))_operator_ilshift, METH_FASTCALL, _operator_ilshift__doc__},
684
685static PyObject *
686_operator_ilshift_impl(PyObject *module, PyObject *a, PyObject *b);
687
688static PyObject *
689_operator_ilshift(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
690{
691 PyObject *return_value = NULL;
692 PyObject *a;
693 PyObject *b;
694
695 if (!_PyArg_CheckPositional("ilshift", nargs, 2, 2)) {
696 goto exit;
697 }
698 a = args[0];
699 b = args[1];
700 return_value = _operator_ilshift_impl(module, a, b);
701
702exit:
703 return return_value;
704}
705
706PyDoc_STRVAR(_operator_irshift__doc__,
707"irshift($module, a, b, /)\n"
708"--\n"
709"\n"
710"Same as a >>= b.");
711
712#define _OPERATOR_IRSHIFT_METHODDEF \
713 {"irshift", (PyCFunction)(void(*)(void))_operator_irshift, METH_FASTCALL, _operator_irshift__doc__},
714
715static PyObject *
716_operator_irshift_impl(PyObject *module, PyObject *a, PyObject *b);
717
718static PyObject *
719_operator_irshift(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
720{
721 PyObject *return_value = NULL;
722 PyObject *a;
723 PyObject *b;
724
725 if (!_PyArg_CheckPositional("irshift", nargs, 2, 2)) {
726 goto exit;
727 }
728 a = args[0];
729 b = args[1];
730 return_value = _operator_irshift_impl(module, a, b);
731
732exit:
733 return return_value;
734}
735
736PyDoc_STRVAR(_operator_iand__doc__,
737"iand($module, a, b, /)\n"
738"--\n"
739"\n"
740"Same as a &= b.");
741
742#define _OPERATOR_IAND_METHODDEF \
743 {"iand", (PyCFunction)(void(*)(void))_operator_iand, METH_FASTCALL, _operator_iand__doc__},
744
745static PyObject *
746_operator_iand_impl(PyObject *module, PyObject *a, PyObject *b);
747
748static PyObject *
749_operator_iand(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
750{
751 PyObject *return_value = NULL;
752 PyObject *a;
753 PyObject *b;
754
755 if (!_PyArg_CheckPositional("iand", nargs, 2, 2)) {
756 goto exit;
757 }
758 a = args[0];
759 b = args[1];
760 return_value = _operator_iand_impl(module, a, b);
761
762exit:
763 return return_value;
764}
765
766PyDoc_STRVAR(_operator_ixor__doc__,
767"ixor($module, a, b, /)\n"
768"--\n"
769"\n"
770"Same as a ^= b.");
771
772#define _OPERATOR_IXOR_METHODDEF \
773 {"ixor", (PyCFunction)(void(*)(void))_operator_ixor, METH_FASTCALL, _operator_ixor__doc__},
774
775static PyObject *
776_operator_ixor_impl(PyObject *module, PyObject *a, PyObject *b);
777
778static PyObject *
779_operator_ixor(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
780{
781 PyObject *return_value = NULL;
782 PyObject *a;
783 PyObject *b;
784
785 if (!_PyArg_CheckPositional("ixor", nargs, 2, 2)) {
786 goto exit;
787 }
788 a = args[0];
789 b = args[1];
790 return_value = _operator_ixor_impl(module, a, b);
791
792exit:
793 return return_value;
794}
795
796PyDoc_STRVAR(_operator_ior__doc__,
797"ior($module, a, b, /)\n"
798"--\n"
799"\n"
800"Same as a |= b.");
801
802#define _OPERATOR_IOR_METHODDEF \
803 {"ior", (PyCFunction)(void(*)(void))_operator_ior, METH_FASTCALL, _operator_ior__doc__},
804
805static PyObject *
806_operator_ior_impl(PyObject *module, PyObject *a, PyObject *b);
807
808static PyObject *
809_operator_ior(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
810{
811 PyObject *return_value = NULL;
812 PyObject *a;
813 PyObject *b;
814
815 if (!_PyArg_CheckPositional("ior", nargs, 2, 2)) {
816 goto exit;
817 }
818 a = args[0];
819 b = args[1];
820 return_value = _operator_ior_impl(module, a, b);
821
822exit:
823 return return_value;
824}
825
826PyDoc_STRVAR(_operator_concat__doc__,
827"concat($module, a, b, /)\n"
828"--\n"
829"\n"
830"Same as a + b, for a and b sequences.");
831
832#define _OPERATOR_CONCAT_METHODDEF \
833 {"concat", (PyCFunction)(void(*)(void))_operator_concat, METH_FASTCALL, _operator_concat__doc__},
834
835static PyObject *
836_operator_concat_impl(PyObject *module, PyObject *a, PyObject *b);
837
838static PyObject *
839_operator_concat(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
840{
841 PyObject *return_value = NULL;
842 PyObject *a;
843 PyObject *b;
844
845 if (!_PyArg_CheckPositional("concat", nargs, 2, 2)) {
846 goto exit;
847 }
848 a = args[0];
849 b = args[1];
850 return_value = _operator_concat_impl(module, a, b);
851
852exit:
853 return return_value;
854}
855
856PyDoc_STRVAR(_operator_iconcat__doc__,
857"iconcat($module, a, b, /)\n"
858"--\n"
859"\n"
860"Same as a += b, for a and b sequences.");
861
862#define _OPERATOR_ICONCAT_METHODDEF \
863 {"iconcat", (PyCFunction)(void(*)(void))_operator_iconcat, METH_FASTCALL, _operator_iconcat__doc__},
864
865static PyObject *
866_operator_iconcat_impl(PyObject *module, PyObject *a, PyObject *b);
867
868static PyObject *
869_operator_iconcat(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
870{
871 PyObject *return_value = NULL;
872 PyObject *a;
873 PyObject *b;
874
875 if (!_PyArg_CheckPositional("iconcat", nargs, 2, 2)) {
876 goto exit;
877 }
878 a = args[0];
879 b = args[1];
880 return_value = _operator_iconcat_impl(module, a, b);
881
882exit:
883 return return_value;
884}
885
886PyDoc_STRVAR(_operator_contains__doc__,
887"contains($module, a, b, /)\n"
888"--\n"
889"\n"
890"Same as b in a (note reversed operands).");
891
892#define _OPERATOR_CONTAINS_METHODDEF \
893 {"contains", (PyCFunction)(void(*)(void))_operator_contains, METH_FASTCALL, _operator_contains__doc__},
894
895static int
896_operator_contains_impl(PyObject *module, PyObject *a, PyObject *b);
897
898static PyObject *
899_operator_contains(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
900{
901 PyObject *return_value = NULL;
902 PyObject *a;
903 PyObject *b;
904 int _return_value;
905
906 if (!_PyArg_CheckPositional("contains", nargs, 2, 2)) {
907 goto exit;
908 }
909 a = args[0];
910 b = args[1];
911 _return_value = _operator_contains_impl(module, a, b);
912 if ((_return_value == -1) && PyErr_Occurred()) {
913 goto exit;
914 }
915 return_value = PyBool_FromLong((long)_return_value);
916
917exit:
918 return return_value;
919}
920
921PyDoc_STRVAR(_operator_indexOf__doc__,
922"indexOf($module, a, b, /)\n"
923"--\n"
924"\n"
925"Return the first index of b in a.");
926
927#define _OPERATOR_INDEXOF_METHODDEF \
928 {"indexOf", (PyCFunction)(void(*)(void))_operator_indexOf, METH_FASTCALL, _operator_indexOf__doc__},
929
930static Py_ssize_t
931_operator_indexOf_impl(PyObject *module, PyObject *a, PyObject *b);
932
933static PyObject *
934_operator_indexOf(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
935{
936 PyObject *return_value = NULL;
937 PyObject *a;
938 PyObject *b;
939 Py_ssize_t _return_value;
940
941 if (!_PyArg_CheckPositional("indexOf", nargs, 2, 2)) {
942 goto exit;
943 }
944 a = args[0];
945 b = args[1];
946 _return_value = _operator_indexOf_impl(module, a, b);
947 if ((_return_value == -1) && PyErr_Occurred()) {
948 goto exit;
949 }
950 return_value = PyLong_FromSsize_t(_return_value);
951
952exit:
953 return return_value;
954}
955
956PyDoc_STRVAR(_operator_countOf__doc__,
957"countOf($module, a, b, /)\n"
958"--\n"
959"\n"
960"Return the number of items in a which are, or which equal, b.");
961
962#define _OPERATOR_COUNTOF_METHODDEF \
963 {"countOf", (PyCFunction)(void(*)(void))_operator_countOf, METH_FASTCALL, _operator_countOf__doc__},
964
965static Py_ssize_t
966_operator_countOf_impl(PyObject *module, PyObject *a, PyObject *b);
967
968static PyObject *
969_operator_countOf(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
970{
971 PyObject *return_value = NULL;
972 PyObject *a;
973 PyObject *b;
974 Py_ssize_t _return_value;
975
976 if (!_PyArg_CheckPositional("countOf", nargs, 2, 2)) {
977 goto exit;
978 }
979 a = args[0];
980 b = args[1];
981 _return_value = _operator_countOf_impl(module, a, b);
982 if ((_return_value == -1) && PyErr_Occurred()) {
983 goto exit;
984 }
985 return_value = PyLong_FromSsize_t(_return_value);
986
987exit:
988 return return_value;
989}
990
991PyDoc_STRVAR(_operator_getitem__doc__,
992"getitem($module, a, b, /)\n"
993"--\n"
994"\n"
995"Same as a[b].");
996
997#define _OPERATOR_GETITEM_METHODDEF \
998 {"getitem", (PyCFunction)(void(*)(void))_operator_getitem, METH_FASTCALL, _operator_getitem__doc__},
999
1000static PyObject *
1001_operator_getitem_impl(PyObject *module, PyObject *a, PyObject *b);
1002
1003static PyObject *
1004_operator_getitem(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1005{
1006 PyObject *return_value = NULL;
1007 PyObject *a;
1008 PyObject *b;
1009
1010 if (!_PyArg_CheckPositional("getitem", nargs, 2, 2)) {
1011 goto exit;
1012 }
1013 a = args[0];
1014 b = args[1];
1015 return_value = _operator_getitem_impl(module, a, b);
1016
1017exit:
1018 return return_value;
1019}
1020
1021PyDoc_STRVAR(_operator_setitem__doc__,
1022"setitem($module, a, b, c, /)\n"
1023"--\n"
1024"\n"
1025"Same as a[b] = c.");
1026
1027#define _OPERATOR_SETITEM_METHODDEF \
1028 {"setitem", (PyCFunction)(void(*)(void))_operator_setitem, METH_FASTCALL, _operator_setitem__doc__},
1029
1030static PyObject *
1031_operator_setitem_impl(PyObject *module, PyObject *a, PyObject *b,
1032 PyObject *c);
1033
1034static PyObject *
1035_operator_setitem(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1036{
1037 PyObject *return_value = NULL;
1038 PyObject *a;
1039 PyObject *b;
1040 PyObject *c;
1041
1042 if (!_PyArg_CheckPositional("setitem", nargs, 3, 3)) {
1043 goto exit;
1044 }
1045 a = args[0];
1046 b = args[1];
1047 c = args[2];
1048 return_value = _operator_setitem_impl(module, a, b, c);
1049
1050exit:
1051 return return_value;
1052}
1053
1054PyDoc_STRVAR(_operator_delitem__doc__,
1055"delitem($module, a, b, /)\n"
1056"--\n"
1057"\n"
1058"Same as del a[b].");
1059
1060#define _OPERATOR_DELITEM_METHODDEF \
1061 {"delitem", (PyCFunction)(void(*)(void))_operator_delitem, METH_FASTCALL, _operator_delitem__doc__},
1062
1063static PyObject *
1064_operator_delitem_impl(PyObject *module, PyObject *a, PyObject *b);
1065
1066static PyObject *
1067_operator_delitem(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1068{
1069 PyObject *return_value = NULL;
1070 PyObject *a;
1071 PyObject *b;
1072
1073 if (!_PyArg_CheckPositional("delitem", nargs, 2, 2)) {
1074 goto exit;
1075 }
1076 a = args[0];
1077 b = args[1];
1078 return_value = _operator_delitem_impl(module, a, b);
1079
1080exit:
1081 return return_value;
1082}
1083
1084PyDoc_STRVAR(_operator_eq__doc__,
1085"eq($module, a, b, /)\n"
1086"--\n"
1087"\n"
1088"Same as a == b.");
1089
1090#define _OPERATOR_EQ_METHODDEF \
1091 {"eq", (PyCFunction)(void(*)(void))_operator_eq, METH_FASTCALL, _operator_eq__doc__},
1092
1093static PyObject *
1094_operator_eq_impl(PyObject *module, PyObject *a, PyObject *b);
1095
1096static PyObject *
1097_operator_eq(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1098{
1099 PyObject *return_value = NULL;
1100 PyObject *a;
1101 PyObject *b;
1102
1103 if (!_PyArg_CheckPositional("eq", nargs, 2, 2)) {
1104 goto exit;
1105 }
1106 a = args[0];
1107 b = args[1];
1108 return_value = _operator_eq_impl(module, a, b);
1109
1110exit:
1111 return return_value;
1112}
1113
1114PyDoc_STRVAR(_operator_ne__doc__,
1115"ne($module, a, b, /)\n"
1116"--\n"
1117"\n"
1118"Same as a != b.");
1119
1120#define _OPERATOR_NE_METHODDEF \
1121 {"ne", (PyCFunction)(void(*)(void))_operator_ne, METH_FASTCALL, _operator_ne__doc__},
1122
1123static PyObject *
1124_operator_ne_impl(PyObject *module, PyObject *a, PyObject *b);
1125
1126static PyObject *
1127_operator_ne(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1128{
1129 PyObject *return_value = NULL;
1130 PyObject *a;
1131 PyObject *b;
1132
1133 if (!_PyArg_CheckPositional("ne", nargs, 2, 2)) {
1134 goto exit;
1135 }
1136 a = args[0];
1137 b = args[1];
1138 return_value = _operator_ne_impl(module, a, b);
1139
1140exit:
1141 return return_value;
1142}
1143
1144PyDoc_STRVAR(_operator_lt__doc__,
1145"lt($module, a, b, /)\n"
1146"--\n"
1147"\n"
1148"Same as a < b.");
1149
1150#define _OPERATOR_LT_METHODDEF \
1151 {"lt", (PyCFunction)(void(*)(void))_operator_lt, METH_FASTCALL, _operator_lt__doc__},
1152
1153static PyObject *
1154_operator_lt_impl(PyObject *module, PyObject *a, PyObject *b);
1155
1156static PyObject *
1157_operator_lt(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1158{
1159 PyObject *return_value = NULL;
1160 PyObject *a;
1161 PyObject *b;
1162
1163 if (!_PyArg_CheckPositional("lt", nargs, 2, 2)) {
1164 goto exit;
1165 }
1166 a = args[0];
1167 b = args[1];
1168 return_value = _operator_lt_impl(module, a, b);
1169
1170exit:
1171 return return_value;
1172}
1173
1174PyDoc_STRVAR(_operator_le__doc__,
1175"le($module, a, b, /)\n"
1176"--\n"
1177"\n"
1178"Same as a <= b.");
1179
1180#define _OPERATOR_LE_METHODDEF \
1181 {"le", (PyCFunction)(void(*)(void))_operator_le, METH_FASTCALL, _operator_le__doc__},
1182
1183static PyObject *
1184_operator_le_impl(PyObject *module, PyObject *a, PyObject *b);
1185
1186static PyObject *
1187_operator_le(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1188{
1189 PyObject *return_value = NULL;
1190 PyObject *a;
1191 PyObject *b;
1192
1193 if (!_PyArg_CheckPositional("le", nargs, 2, 2)) {
1194 goto exit;
1195 }
1196 a = args[0];
1197 b = args[1];
1198 return_value = _operator_le_impl(module, a, b);
1199
1200exit:
1201 return return_value;
1202}
1203
1204PyDoc_STRVAR(_operator_gt__doc__,
1205"gt($module, a, b, /)\n"
1206"--\n"
1207"\n"
1208"Same as a > b.");
1209
1210#define _OPERATOR_GT_METHODDEF \
1211 {"gt", (PyCFunction)(void(*)(void))_operator_gt, METH_FASTCALL, _operator_gt__doc__},
1212
1213static PyObject *
1214_operator_gt_impl(PyObject *module, PyObject *a, PyObject *b);
1215
1216static PyObject *
1217_operator_gt(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1218{
1219 PyObject *return_value = NULL;
1220 PyObject *a;
1221 PyObject *b;
1222
1223 if (!_PyArg_CheckPositional("gt", nargs, 2, 2)) {
1224 goto exit;
1225 }
1226 a = args[0];
1227 b = args[1];
1228 return_value = _operator_gt_impl(module, a, b);
1229
1230exit:
1231 return return_value;
1232}
1233
1234PyDoc_STRVAR(_operator_ge__doc__,
1235"ge($module, a, b, /)\n"
1236"--\n"
1237"\n"
1238"Same as a >= b.");
1239
1240#define _OPERATOR_GE_METHODDEF \
1241 {"ge", (PyCFunction)(void(*)(void))_operator_ge, METH_FASTCALL, _operator_ge__doc__},
1242
1243static PyObject *
1244_operator_ge_impl(PyObject *module, PyObject *a, PyObject *b);
1245
1246static PyObject *
1247_operator_ge(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1248{
1249 PyObject *return_value = NULL;
1250 PyObject *a;
1251 PyObject *b;
1252
1253 if (!_PyArg_CheckPositional("ge", nargs, 2, 2)) {
1254 goto exit;
1255 }
1256 a = args[0];
1257 b = args[1];
1258 return_value = _operator_ge_impl(module, a, b);
1259
1260exit:
1261 return return_value;
1262}
1263
1264PyDoc_STRVAR(_operator_pow__doc__,
1265"pow($module, a, b, /)\n"
1266"--\n"
1267"\n"
1268"Same as a ** b.");
1269
1270#define _OPERATOR_POW_METHODDEF \
1271 {"pow", (PyCFunction)(void(*)(void))_operator_pow, METH_FASTCALL, _operator_pow__doc__},
1272
1273static PyObject *
1274_operator_pow_impl(PyObject *module, PyObject *a, PyObject *b);
1275
1276static PyObject *
1277_operator_pow(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1278{
1279 PyObject *return_value = NULL;
1280 PyObject *a;
1281 PyObject *b;
1282
1283 if (!_PyArg_CheckPositional("pow", nargs, 2, 2)) {
1284 goto exit;
1285 }
1286 a = args[0];
1287 b = args[1];
1288 return_value = _operator_pow_impl(module, a, b);
1289
1290exit:
1291 return return_value;
1292}
1293
1294PyDoc_STRVAR(_operator_ipow__doc__,
1295"ipow($module, a, b, /)\n"
1296"--\n"
1297"\n"
1298"Same as a **= b.");
1299
1300#define _OPERATOR_IPOW_METHODDEF \
1301 {"ipow", (PyCFunction)(void(*)(void))_operator_ipow, METH_FASTCALL, _operator_ipow__doc__},
1302
1303static PyObject *
1304_operator_ipow_impl(PyObject *module, PyObject *a, PyObject *b);
1305
1306static PyObject *
1307_operator_ipow(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1308{
1309 PyObject *return_value = NULL;
1310 PyObject *a;
1311 PyObject *b;
1312
1313 if (!_PyArg_CheckPositional("ipow", nargs, 2, 2)) {
1314 goto exit;
1315 }
1316 a = args[0];
1317 b = args[1];
1318 return_value = _operator_ipow_impl(module, a, b);
1319
1320exit:
1321 return return_value;
1322}
1323
1324PyDoc_STRVAR(_operator_index__doc__,
1325"index($module, a, /)\n"
1326"--\n"
1327"\n"
1328"Same as a.__index__()");
1329
1330#define _OPERATOR_INDEX_METHODDEF \
1331 {"index", (PyCFunction)_operator_index, METH_O, _operator_index__doc__},
1332
1333PyDoc_STRVAR(_operator_is___doc__,
1334"is_($module, a, b, /)\n"
1335"--\n"
1336"\n"
1337"Same as a is b.");
1338
1339#define _OPERATOR_IS__METHODDEF \
1340 {"is_", (PyCFunction)(void(*)(void))_operator_is_, METH_FASTCALL, _operator_is___doc__},
1341
1342static PyObject *
1343_operator_is__impl(PyObject *module, PyObject *a, PyObject *b);
1344
1345static PyObject *
1346_operator_is_(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1347{
1348 PyObject *return_value = NULL;
1349 PyObject *a;
1350 PyObject *b;
1351
1352 if (!_PyArg_CheckPositional("is_", nargs, 2, 2)) {
1353 goto exit;
1354 }
1355 a = args[0];
1356 b = args[1];
1357 return_value = _operator_is__impl(module, a, b);
1358
1359exit:
1360 return return_value;
1361}
1362
1363PyDoc_STRVAR(_operator_is_not__doc__,
1364"is_not($module, a, b, /)\n"
1365"--\n"
1366"\n"
1367"Same as a is not b.");
1368
1369#define _OPERATOR_IS_NOT_METHODDEF \
1370 {"is_not", (PyCFunction)(void(*)(void))_operator_is_not, METH_FASTCALL, _operator_is_not__doc__},
1371
1372static PyObject *
1373_operator_is_not_impl(PyObject *module, PyObject *a, PyObject *b);
1374
1375static PyObject *
1376_operator_is_not(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1377{
1378 PyObject *return_value = NULL;
1379 PyObject *a;
1380 PyObject *b;
1381
1382 if (!_PyArg_CheckPositional("is_not", nargs, 2, 2)) {
1383 goto exit;
1384 }
1385 a = args[0];
1386 b = args[1];
1387 return_value = _operator_is_not_impl(module, a, b);
1388
1389exit:
1390 return return_value;
1391}
1392
1393PyDoc_STRVAR(_operator_length_hint__doc__,
1394"length_hint($module, obj, default=0, /)\n"
1395"--\n"
1396"\n"
1397"Return an estimate of the number of items in obj.\n"
1398"\n"
1399"This is useful for presizing containers when building from an iterable.\n"
1400"\n"
1401"If the object supports len(), the result will be exact.\n"
1402"Otherwise, it may over- or under-estimate by an arbitrary amount.\n"
1403"The result will be an integer >= 0.");
1404
1405#define _OPERATOR_LENGTH_HINT_METHODDEF \
1406 {"length_hint", (PyCFunction)(void(*)(void))_operator_length_hint, METH_FASTCALL, _operator_length_hint__doc__},
1407
1408static Py_ssize_t
1409_operator_length_hint_impl(PyObject *module, PyObject *obj,
1410 Py_ssize_t default_value);
1411
1412static PyObject *
1413_operator_length_hint(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1414{
1415 PyObject *return_value = NULL;
1416 PyObject *obj;
1417 Py_ssize_t default_value = 0;
1418 Py_ssize_t _return_value;
1419
1420 if (!_PyArg_CheckPositional("length_hint", nargs, 1, 2)) {
1421 goto exit;
1422 }
1423 obj = args[0];
1424 if (nargs < 2) {
1425 goto skip_optional;
1426 }
1427 {
1428 Py_ssize_t ival = -1;
1429 PyObject *iobj = _PyNumber_Index(args[1]);
1430 if (iobj != NULL) {
1431 ival = PyLong_AsSsize_t(iobj);
1432 Py_DECREF(iobj);
1433 }
1434 if (ival == -1 && PyErr_Occurred()) {
1435 goto exit;
1436 }
1437 default_value = ival;
1438 }
1439skip_optional:
1440 _return_value = _operator_length_hint_impl(module, obj, default_value);
1441 if ((_return_value == -1) && PyErr_Occurred()) {
1442 goto exit;
1443 }
1444 return_value = PyLong_FromSsize_t(_return_value);
1445
1446exit:
1447 return return_value;
1448}
1449
1450PyDoc_STRVAR(_operator__compare_digest__doc__,
1451"_compare_digest($module, a, b, /)\n"
1452"--\n"
1453"\n"
1454"Return \'a == b\'.\n"
1455"\n"
1456"This function uses an approach designed to prevent\n"
1457"timing analysis, making it appropriate for cryptography.\n"
1458"\n"
1459"a and b must both be of the same type: either str (ASCII only),\n"
1460"or any bytes-like object.\n"
1461"\n"
1462"Note: If a and b are of different lengths, or if an error occurs,\n"
1463"a timing attack could theoretically reveal information about the\n"
1464"types and lengths of a and b--but not their values.");
1465
1466#define _OPERATOR__COMPARE_DIGEST_METHODDEF \
1467 {"_compare_digest", (PyCFunction)(void(*)(void))_operator__compare_digest, METH_FASTCALL, _operator__compare_digest__doc__},
1468
1469static PyObject *
1470_operator__compare_digest_impl(PyObject *module, PyObject *a, PyObject *b);
1471
1472static PyObject *
1473_operator__compare_digest(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1474{
1475 PyObject *return_value = NULL;
1476 PyObject *a;
1477 PyObject *b;
1478
1479 if (!_PyArg_CheckPositional("_compare_digest", nargs, 2, 2)) {
1480 goto exit;
1481 }
1482 a = args[0];
1483 b = args[1];
1484 return_value = _operator__compare_digest_impl(module, a, b);
1485
1486exit:
1487 return return_value;
1488}
1489/*[clinic end generated code: output=16749e11fda51785 input=a9049054013a1b77]*/
1490