bpo-45636: Simplify BINARY_OP (GH-29565)

This commit is contained in:
Brandt Bucher 2021-11-16 05:53:57 -08:00 committed by GitHub
parent 55868f1a33
commit 6a84d61c55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 51 additions and 83 deletions

View file

@ -1152,6 +1152,12 @@ PyNumber_Power(PyObject *v, PyObject *w, PyObject *z)
return ternary_op(v, w, z, NB_SLOT(nb_power), "** or pow()");
}
PyObject *
_PyNumber_PowerNoMod(PyObject *lhs, PyObject *rhs)
{
return PyNumber_Power(lhs, rhs, Py_None);
}
/* Binary in-place operators */
/* The in-place operators are defined to fall back to the 'normal',
@ -1331,6 +1337,12 @@ PyNumber_InPlacePower(PyObject *v, PyObject *w, PyObject *z)
NB_SLOT(nb_power), "**=");
}
PyObject *
_PyNumber_InPlacePowerNoMod(PyObject *lhs, PyObject *rhs)
{
return PyNumber_InPlacePower(lhs, rhs, Py_None);
}
/* Unary operators and functions */