Skip to content

Commit f32830b

Browse files
committed
+2
1 parent d3f8428 commit f32830b

File tree

2 files changed

+88
-9
lines changed

2 files changed

+88
-9
lines changed

Modules/_decimal/_decimal.c

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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,32 @@ 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+
x: object
6946+
y: object
6947+
/
6948+
6949+
Compare x and y using their abstract representation.
6950+
[clinic start generated code]*/
6951+
6952+
static PyObject *
6953+
_decimal_Context_compare_total_impl(PyObject *self, PyObject *x, PyObject *y)
6954+
/*[clinic end generated code: output=c8b3bc8c2db253c3 input=17d5df4a130712e7]*/
69486955
DecCtx_BinaryFunc_NO_CTX(mpd_compare_total)
6956+
6957+
/*[clinic input]
6958+
_decimal.Context.compare_total_mag = _decimal.Context.compare_total
6959+
6960+
Compare x and y using their abstract representation, ignoring sign.
6961+
[clinic start generated code]*/
6962+
6963+
static PyObject *
6964+
_decimal_Context_compare_total_mag_impl(PyObject *self, PyObject *x,
6965+
PyObject *y)
6966+
/*[clinic end generated code: output=725b7209e0897ac6 input=2b982e69f932dcb2]*/
69496967
DecCtx_BinaryFunc_NO_CTX(mpd_compare_total_mag)
69506968

69516969
static PyObject *

Modules/_decimal/clinic/_decimal.c.h

Lines changed: 62 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)