Revert "gh-89381: Fix invalid signatures of math/cmath.log (#101404)" (#101580)

This reverts commit 0ef92d9793.
This commit is contained in:
Mark Dickinson 2023-02-05 16:36:33 +00:00 committed by GitHub
parent 19ac43629e
commit 0672a6c23b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 47 additions and 42 deletions

View file

@ -2366,24 +2366,26 @@ loghelper(PyObject* arg, double (*func)(double))
math.log
x: object
base: object = None
[
base: object(c_default="NULL") = math.e
]
/
Return the logarithm of x to the given base.
If the base is not specified or is None, returns the natural
logarithm (base e) of x.
If the base not specified, returns the natural logarithm (base e) of x.
[clinic start generated code]*/
static PyObject *
math_log_impl(PyObject *module, PyObject *x, PyObject *base)
/*[clinic end generated code: output=1dead263cbb1e854 input=ef032cc9837943e1]*/
math_log_impl(PyObject *module, PyObject *x, int group_right_1,
PyObject *base)
/*[clinic end generated code: output=7b5a39e526b73fc9 input=0f62d5726cbfebbd]*/
{
PyObject *num, *den;
PyObject *ans;
num = loghelper(x, m_log);
if (num == NULL || base == Py_None)
if (num == NULL || base == NULL)
return num;
den = loghelper(base, m_log);