Skip to content

Commit

Permalink
+ last argument for UNARY_FUNC()
Browse files Browse the repository at this point in the history
  • Loading branch information
skirpichev committed Nov 16, 2023
1 parent 56b5e1f commit b0d2f78
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Objects/abstract.c
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ _PyNumber_InPlacePowerNoMod(PyObject *lhs, PyObject *rhs)

/* Unary operators and functions */

#define UNARY_FUNC(func, op, meth_name) \
#define UNARY_FUNC(func, op, meth_name, descr) \
PyObject * \
func(PyObject *o) { \
if (o == NULL) { \
Expand All @@ -1358,13 +1358,13 @@ _PyNumber_InPlacePowerNoMod(PyObject *lhs, PyObject *rhs)
return res; \
} \
\
return type_error("bad operand type for unary -: '%.200s'", o); \
return type_error("bad operand type for "descr": '%.200s'", o); \
}

UNARY_FUNC(PyNumber_Negative, nb_negative, __neg__)
UNARY_FUNC(PyNumber_Positive, nb_positive, __pow__)
UNARY_FUNC(PyNumber_Invert, nb_invert, __invert__)
UNARY_FUNC(PyNumber_Absolute, nb_absolute, __abs__)
UNARY_FUNC(PyNumber_Negative, nb_negative, __neg__, "unary -")
UNARY_FUNC(PyNumber_Positive, nb_positive, __pow__, "unary +")
UNARY_FUNC(PyNumber_Invert, nb_invert, __invert__, "unary ~")
UNARY_FUNC(PyNumber_Absolute, nb_absolute, __abs__, "abs()")


int
Expand Down

0 comments on commit b0d2f78

Please sign in to comment.