@@ -6112,18 +6112,11 @@ static PyType_Spec dec_spec = {
61126112 * The actual MPDFUNC does NOT take a context arg.
61136113 */
61146114#define DecCtx_BinaryFunc_NO_CTX (MPDFUNC ) \
6115- static PyObject * \
6116- ctx_##MPDFUNC(PyObject *context, PyObject *args) \
61176115{ \
6118- PyObject *v, *w; \
61196116 PyObject *a, *b; \
61206117 PyObject *result; \
61216118 \
6122- if (!PyArg_ParseTuple(args, "OO", &v, &w)) { \
6123- return NULL; \
6124- } \
6125- \
6126- CONVERT_BINOP_RAISE(&a, &b, v, w, context); \
6119+ CONVERT_BINOP_RAISE(&a, &b, x, y, context); \
61276120 decimal_state *state = \
61286121 get_module_state_from_ctx(context); \
61296122 if ((result = dec_alloc(state)) == NULL) { \
@@ -6945,7 +6938,34 @@ ctx_mpd_to_eng(PyObject *context, PyObject *v)
69456938}
69466939
69476940/* Functions with two decimal arguments */
6941+
6942+ /*[clinic input]
6943+ _decimal.Context.compare_total
6944+
6945+ self as context: self
6946+ x: object
6947+ y: object
6948+ /
6949+
6950+ Compare x and y using their abstract representation.
6951+ [clinic start generated code]*/
6952+
6953+ static PyObject *
6954+ _decimal_Context_compare_total_impl (PyObject * context , PyObject * x ,
6955+ PyObject * y )
6956+ /*[clinic end generated code: output=a9299ef125fb2245 input=020b30c9bc2ea2c6]*/
69486957DecCtx_BinaryFunc_NO_CTX (mpd_compare_total )
6958+
6959+ /*[clinic input]
6960+ _decimal.Context.compare_total_mag = _decimal.Context.compare_total
6961+
6962+ Compare x and y using their abstract representation, ignoring sign.
6963+ [clinic start generated code]*/
6964+
6965+ static PyObject *
6966+ _decimal_Context_compare_total_mag_impl (PyObject * context , PyObject * x ,
6967+ PyObject * y )
6968+ /*[clinic end generated code: output=7c376de9f94feeaf input=2b982e69f932dcb2]*/
69496969DecCtx_BinaryFunc_NO_CTX (mpd_compare_total_mag )
69506970
69516971static PyObject *
@@ -7143,8 +7163,8 @@ static PyMethodDef context_methods [] =
71437163 { "to_eng_string" , ctx_mpd_to_eng , METH_O , doc_ctx_to_eng_string },
71447164
71457165 /* Functions with two decimal arguments */
7146- { "compare_total" , ctx_mpd_compare_total , METH_VARARGS , doc_ctx_compare_total },
7147- { "compare_total_mag" , ctx_mpd_compare_total_mag , METH_VARARGS , doc_ctx_compare_total_mag },
7166+ _DECIMAL_CONTEXT_COMPARE_TOTAL_METHODDEF
7167+ _DECIMAL_CONTEXT_COMPARE_TOTAL_MAG_METHODDEF
71487168 { "copy_sign" , ctx_mpd_qcopy_sign , METH_VARARGS , doc_ctx_copy_sign },
71497169 _DECIMAL_CONTEXT_LOGICAL_AND_METHODDEF
71507170 _DECIMAL_CONTEXT_LOGICAL_OR_METHODDEF
0 commit comments