#include "parts.h" #include "util.h" static PyObject * number_check(PyObject *Py_UNUSED(module), PyObject *obj) { … } #define BINARYFUNC(funcsuffix, methsuffix) … BINARYFUNC(Add, add) BINARYFUNC(Subtract, subtract) BINARYFUNC(Multiply, multiply) BINARYFUNC(MatrixMultiply, matrixmultiply) BINARYFUNC(FloorDivide, floordivide) BINARYFUNC(TrueDivide, truedivide) BINARYFUNC(Remainder, remainder) BINARYFUNC(Divmod, divmod) #define TERNARYFUNC(funcsuffix, methsuffix) … TERNARYFUNC(Power, power) #define UNARYFUNC(funcsuffix, methsuffix) … UNARYFUNC(Negative, negative) UNARYFUNC(Positive, positive) UNARYFUNC(Absolute, absolute) UNARYFUNC(Invert, invert) BINARYFUNC(Lshift, lshift) BINARYFUNC(Rshift, rshift) BINARYFUNC(And, and) BINARYFUNC(Xor, xor) BINARYFUNC(Or, or) BINARYFUNC(InPlaceAdd, inplaceadd) BINARYFUNC(InPlaceSubtract, inplacesubtract) BINARYFUNC(InPlaceMultiply, inplacemultiply) BINARYFUNC(InPlaceMatrixMultiply, inplacematrixmultiply) BINARYFUNC(InPlaceFloorDivide, inplacefloordivide) BINARYFUNC(InPlaceTrueDivide, inplacetruedivide) BINARYFUNC(InPlaceRemainder, inplaceremainder) TERNARYFUNC(InPlacePower, inplacepower) BINARYFUNC(InPlaceLshift, inplacelshift) BINARYFUNC(InPlaceRshift, inplacershift) BINARYFUNC(InPlaceAnd, inplaceand) BINARYFUNC(InPlaceXor, inplacexor) BINARYFUNC(InPlaceOr, inplaceor) UNARYFUNC(Long, long) UNARYFUNC(Float, float) UNARYFUNC(Index, index) static PyObject * number_tobase(PyObject *Py_UNUSED(module), PyObject *args) { … } static PyObject * number_asssizet(PyObject *Py_UNUSED(module), PyObject *args) { … } static PyMethodDef test_methods[] = …; int _PyTestCapi_Init_Numbers(PyObject *mod) { … }