Coverage Report

Created: 2025-07-04 06:49

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