Skip to content

Commit 31fa34f

Browse files
committed
address review: update comments
1 parent d18f805 commit 31fa34f

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

Modules/_decimal/_decimal.c

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4468,18 +4468,20 @@ nm_##MPDFUNC(PyObject *self, PyObject *other) \
44684468
}
44694469

44704470
/* Boolean function with an optional context arg.
4471-
Argument Clinic provides PyObject *self, PyObject *context
4471+
Argument Clinic provides PyObject *self, PyTypeObject *cls,
4472+
PyObject *context
44724473
*/
44734474
#define Dec_BoolFuncVA(MPDFUNC) \
44744475
{ \
4475-
decimal_state *state = get_module_state_by_def(Py_TYPE(self)); \
4476+
decimal_state *state = PyType_GetModuleState(cls); \
44764477
CONTEXT_CHECK_VA(state, context); \
44774478
\
44784479
return MPDFUNC(MPD(self), CTX(context)) ? incr_true() : incr_false(); \
44794480
}
44804481

44814482
/* Unary function with an optional context arg.
4482-
Argument Clinic provides PyObject *self, PyObject *context
4483+
Argument Clinic provides PyObject *self, PyTypeObject *cls,
4484+
PyObject *context
44834485
*/
44844486
#define Dec_UnaryFuncVA(MPDFUNC) \
44854487
{ \
@@ -4502,7 +4504,8 @@ nm_##MPDFUNC(PyObject *self, PyObject *other) \
45024504
}
45034505

45044506
/* Binary function with an optional context arg.
4505-
Argument Clinic provides PyObject *self, PyObject *other, PyObject *context
4507+
Argument Clinic provides PyObject *self, PyTypeObject *cls,
4508+
PyObject *other, PyObject *context
45064509
*/
45074510
#define Dec_BinaryFuncVA(MPDFUNC) \
45084511
{ \
@@ -4534,7 +4537,8 @@ nm_##MPDFUNC(PyObject *self, PyObject *other) \
45344537
NOT take a context. The context is used to record InvalidOperation
45354538
if the second operand cannot be converted exactly.
45364539
4537-
Argument Clinic provides PyObject *self, PyObject *other, PyObject *context
4540+
Argument Clinic provides PyObject *self, PyTypeObject *cls,
4541+
PyObject *other, PyObject *context
45384542
*/
45394543
#define Dec_BinaryFuncVA_NO_CTX(MPDFUNC) \
45404544
{ \
@@ -4559,7 +4563,8 @@ nm_##MPDFUNC(PyObject *self, PyObject *other) \
45594563
}
45604564

45614565
/* Ternary function with an optional context arg.
4562-
Argument Clinic provides PyObject *self, PyObject *other, PyObject *third,
4566+
Argument Clinic provides PyObject *self, PyTypeObject *cls,
4567+
PyObject *other, PyObject *third,
45634568
PyObject *context
45644569
*/
45654570
#define Dec_TernaryFuncVA(MPDFUNC) \
@@ -6194,7 +6199,8 @@ static PyType_Spec dec_spec = {
61946199
}
61956200

61966201
/* Unary context method.
6197-
Argument Clinic provides PyObject *context, PyObject *x
6202+
Argument Clinic provides PyObject *context,
6203+
PyTypeObject *cls, PyObject *x
61986204
*/
61996205
#define DecCtx_UnaryFunc(MPDFUNC) \
62006206
{ \
@@ -6219,7 +6225,8 @@ static PyType_Spec dec_spec = {
62196225
}
62206226

62216227
/* Binary context method.
6222-
Argument Clinic provides PyObject *context, PyObject *x, PyObject *y
6228+
Argument Clinic provides PyObject *context, PyTypeObject *cls,
6229+
PyObject *x, PyObject *y
62236230
*/
62246231
#define DecCtx_BinaryFunc(MPDFUNC) \
62256232
{ \
@@ -6249,7 +6256,8 @@ static PyType_Spec dec_spec = {
62496256
/*
62506257
* Binary context method. The context is only used for conversion.
62516258
* The actual MPDFUNC does NOT take a context arg.
6252-
* Argument Clinic provides PyObject *context, PyObject *x, PyObject *y
6259+
* Argument Clinic provides PyObject *context, PyTypeObject *cls,
6260+
* PyObject *x, PyObject *y
62536261
*/
62546262
#define DecCtx_BinaryFunc_NO_CTX(MPDFUNC) \
62556263
{ \
@@ -6273,8 +6281,8 @@ static PyType_Spec dec_spec = {
62736281
}
62746282

62756283
/* Ternary context method.
6276-
Argument Clinic provides PyObject *context, PyObject *x, PyObject *y,
6277-
PyObject *z
6284+
Argument Clinic provides PyObject *context, PyTypeObject *cls,
6285+
PyObject *x, PyObject *y, PyObject *z
62786286
*/
62796287
#define DecCtx_TernaryFunc(MPDFUNC) \
62806288
{ \

0 commit comments

Comments
 (0)